[llvm] [InstCombine] Make the `(icmp eq/ne (and X, Y), X)` canonicalization work for non-const operands (PR #84688)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 22 06:38:48 PDT 2024


================
@@ -4709,6 +4709,26 @@ static Instruction *foldICmpAndXX(ICmpInst &I, const SimplifyQuery &Q,
   if (Pred == ICmpInst::ICMP_UGE)
     return new ICmpInst(ICmpInst::ICMP_EQ, Op0, Op1);
 
+  if (ICmpInst::isEquality(Pred) && Op0->hasOneUse()) {
----------------
dtcxzyw wrote:

We need a multi-use test.


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


More information about the llvm-commits mailing list