[llvm] [GISel][CombinerHelper] Combine op(trunc(x), trunc(y)) -> trunc(op(x, y)) (PR #89023)
Dhruv Chawla via llvm-commits
llvm-commits at lists.llvm.org
Thu May 30 06:47:54 PDT 2024
================
@@ -3157,6 +3157,20 @@ bool CombinerHelper::matchHoistLogicOpWithSameOpcodeHands(
// Match: logic (ext X), (ext Y) --> ext (logic X, Y)
break;
}
+ case TargetOpcode::G_TRUNC: {
+ // Match: logic (trunc X), (trunc Y) -> trunc (logic X, Y)
+ MachineFunction *MF = MI.getMF();
+ EVT DstEVT = getApproximateEVTForLLT(MRI.getType(Dst), MF->getDataLayout(),
+ MF->getFunction().getContext());
+ EVT XEVT = getApproximateEVTForLLT(XTy, MF->getDataLayout(),
+ MF->getFunction().getContext());
----------------
dc03-work wrote:
Okay, done.
https://github.com/llvm/llvm-project/pull/89023
More information about the llvm-commits
mailing list