[llvm] [InstCombine] fold `(icmp eq/ne (or disjoint x, C0), C1)` -> `(icmp eq/ne x, C0^C1)` (PR #87734)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 5 00:54:54 PDT 2024


================
@@ -2049,6 +2050,16 @@ Instruction *InstCombinerImpl::foldICmpOrConstant(ICmpInst &Cmp,
   }
 
   Value *OrOp0 = Or->getOperand(0), *OrOp1 = Or->getOperand(1);
+
+  // (icmp eq/ne (or disjoint x, C0), C1)
----------------
dtcxzyw wrote:

I am not sure whether we should put the logic in `InstCombinerImpl::foldICmpBinOpEqualityWithConstant` or not.

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


More information about the llvm-commits mailing list