File tree 1 file changed +8
-6
lines changed
llvm/lib/CodeGen/GlobalISel
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -3160,15 +3160,17 @@ bool CombinerHelper::matchHoistLogicOpWithSameOpcodeHands(
3160
3160
}
3161
3161
case TargetOpcode::G_TRUNC: {
3162
3162
// Match: logic (trunc X), (trunc Y) -> trunc (logic X, Y)
3163
- MachineFunction *MF = MI.getMF ();
3164
- EVT DstEVT = getApproximateEVTForLLT (MRI. getType (Dst), MF->getDataLayout (),
3165
- MF->getFunction ().getContext () );
3166
- EVT XEVT = getApproximateEVTForLLT (XTy, MF-> getDataLayout (),
3167
- MF-> getFunction (). getContext () );
3163
+ const MachineFunction *MF = MI.getMF ();
3164
+ const DataLayout &DL = MF->getDataLayout ();
3165
+ LLVMContext &Ctx = MF->getFunction ().getContext ();
3166
+
3167
+ LLT DstTy = MRI. getType (Dst );
3168
3168
const TargetLowering &TLI = getTargetLowering ();
3169
+
3169
3170
// Be extra careful sinking truncate. If it's free, there's no benefit in
3170
3171
// widening a binop.
3171
- if (TLI.isZExtFree (DstEVT, XEVT) && TLI.isTruncateFree (XEVT, DstEVT))
3172
+ if (TLI.isZExtFree (DstTy, XTy, DL, Ctx) &&
3173
+ TLI.isTruncateFree (XTy, DstTy, DL, Ctx))
3172
3174
return false ;
3173
3175
break ;
3174
3176
}
You can’t perform that action at this time.
0 commit comments