[llvm] [InstCombine] Further relax one-use constraint in `foldICmpBinOp` (PR #122266)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 10 08:26:52 PST 2025


================
@@ -5468,7 +5467,8 @@ Instruction *InstCombinerImpl::foldICmpBinOp(ICmpInst &I,
         break;
 
       const APInt *C;
-      if (match(BO0->getOperand(1), m_APInt(C)) && !C->isZero() &&
+      if (BO0->hasOneUse() && BO1->hasOneUse() &&
----------------
goldsteinn wrote:

Yeah fair enough, just this case is not relaxing the constraint, its tightening it.

https://github.com/llvm/llvm-project/pull/122266


More information about the llvm-commits mailing list