llvm.org GIT mirror llvm / aafe626
remove some llvmcontext arguments that are now dead post-refactoring. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112104 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 10 years ago
5 changed file(s) with 16 addition(s) and 24 deletion(s). Raw diff Collapse all Expand all
250250 std::fill(ValueTypeActions, array_endof(ValueTypeActions), 0);
251251 }
252252
253 /// FIXME: This Context argument is now dead, zap it.
254 LegalizeAction getTypeAction(LLVMContext &Context, EVT VT) const {
255 return getTypeAction(VT);
256 }
257
258253 LegalizeAction getTypeAction(EVT VT) const {
259254 if (!VT.isExtended())
260255 return getTypeAction(VT.getSimpleVT());
280275 /// it is already legal (return 'Legal') or we need to promote it to a larger
281276 /// type (return 'Promote'), or we need to expand it into multiple registers
282277 /// of smaller integer type (return 'Expand'). 'Custom' is not an option.
283 LegalizeAction getTypeAction(LLVMContext &Context, EVT VT) const {
284 return ValueTypeActions.getTypeAction(Context, VT);
278 LegalizeAction getTypeAction(EVT VT) const {
279 return ValueTypeActions.getTypeAction(VT);
285280 }
286281
287282 /// getTypeToTransformTo - For types supported by the target, this is an
295290 assert((unsigned)VT.getSimpleVT().SimpleTy <
296291 array_lengthof(TransformToType));
297292 EVT NVT = TransformToType[VT.getSimpleVT().SimpleTy];
298 assert(getTypeAction(Context, NVT) != Promote &&
293 assert(getTypeAction(NVT) != Promote &&
299294 "Promote may not follow Expand or Promote");
300295 return NVT;
301296 }
310305 EltVT : EVT::getVectorVT(Context, EltVT, NumElts / 2);
311306 }
312307 // Promote to a power of two size, avoiding multi-step promotion.
313 return getTypeAction(Context, NVT) == Promote ?
308 return getTypeAction(NVT) == Promote ?
314309 getTypeToTransformTo(Context, NVT) : NVT;
315310 } else if (VT.isInteger()) {
316311 EVT NVT = VT.getRoundIntegerType(Context);
317 if (NVT == VT)
318 // Size is a power of two - expand to half the size.
312 if (NVT == VT) // Size is a power of two - expand to half the size.
319313 return EVT::getIntegerVT(Context, VT.getSizeInBits() / 2);
320 else
321 // Promote to a power of two size, avoiding multi-step promotion.
322 return getTypeAction(Context, NVT) == Promote ?
323 getTypeToTransformTo(Context, NVT) : NVT;
314
315 // Promote to a power of two size, avoiding multi-step promotion.
316 return getTypeAction(NVT) == Promote ?
317 getTypeToTransformTo(Context, NVT) : NVT;
324318 }
325319 assert(0 && "Unsupported extended type!");
326320 return MVT(MVT::Other); // Not reached
333327 EVT getTypeToExpandTo(LLVMContext &Context, EVT VT) const {
334328 assert(!VT.isVector());
335329 while (true) {
336 switch (getTypeAction(Context, VT)) {
330 switch (getTypeAction(VT)) {
337331 case Legal:
338332 return VT;
339333 case Expand:
9999 /// it is already legal or we need to expand it into multiple registers of
100100 /// smaller integer type, or we need to promote it to a larger type.
101101 LegalizeAction getTypeAction(EVT VT) const {
102 return
103 (LegalizeAction)ValueTypeActions.getTypeAction(*DAG.getContext(), VT);
102 return (LegalizeAction)ValueTypeActions.getTypeAction(VT);
104103 }
105104
106105 /// isTypeLegal - Return true if this type is legal on this target.
7474
7575 /// getTypeAction - Return how we should legalize values of this type.
7676 LegalizeAction getTypeAction(EVT VT) const {
77 switch (ValueTypeActions.getTypeAction(*DAG.getContext(), VT)) {
77 switch (ValueTypeActions.getTypeAction(VT)) {
7878 default:
7979 assert(false && "Unknown legalize action!");
8080 case TargetLowering::Legal:
107107
108108 /// isTypeLegal - Return true if this type is legal on this target.
109109 bool isTypeLegal(EVT VT) const {
110 return (ValueTypeActions.getTypeAction(*DAG.getContext(), VT) ==
111 TargetLowering::Legal);
110 return ValueTypeActions.getTypeAction(VT) == TargetLowering::Legal;
112111 }
113112
114113 /// IgnoreNodeResults - Pretend all of this node's results are legal.
868868 // If there is a wider vector type with the same element type as this one,
869869 // we should widen to that legal vector type. This handles things like
870870 // <2 x float> -> <4 x float>.
871 if (NumElts != 1 && getTypeAction(Context, VT) == Promote) {
871 if (NumElts != 1 && getTypeAction(VT) == Promote) {
872872 RegisterVT = getTypeToTransformTo(Context, VT);
873873 if (isTypeLegal(RegisterVT)) {
874874 IntermediateVT = RegisterVT;
432432 // If these values will be promoted, find out what they will be promoted
433433 // to. This helps us consider truncates on PPC as noop copies when they
434434 // are.
435 if (TLI.getTypeAction(CI->getContext(), SrcVT) == TargetLowering::Promote)
435 if (TLI.getTypeAction(SrcVT) == TargetLowering::Promote)
436436 SrcVT = TLI.getTypeToTransformTo(CI->getContext(), SrcVT);
437 if (TLI.getTypeAction(CI->getContext(), DstVT) == TargetLowering::Promote)
437 if (TLI.getTypeAction(DstVT) == TargetLowering::Promote)
438438 DstVT = TLI.getTypeToTransformTo(CI->getContext(), DstVT);
439439
440440 // If, after promotion, these are the same types, this is a noop copy.