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

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 10 19:32:51 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() &&
----------------
dtcxzyw wrote:

Yes. I already pointed out this in the PR description.


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


More information about the llvm-commits mailing list