[llvm] Issue 180492 (PR #180596)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 10 05:54:18 PST 2026


================
@@ -7894,6 +7894,28 @@ Instruction *InstCombinerImpl::visitICmpInst(ICmpInst &I) {
     }
   }
 
+  // icmp eq (shl (zext i1 x), (zext i1 y)), 1 --> and i1 x, (not i1 y)
+  // icmp ne (shl (zext i1 x), (zext i1 y)), 1 --> or i1 (not i1 x), y
+  {
+    Value *A, *B;
+    CmpPredicate CmpPred;
+
+    if (match(&I,
+              m_c_ICmp(CmpPred, m_Shl(m_ZExt(m_Value(A)), m_ZExt(m_Value(B))),
+                       m_One())) &&
+        A->getType()->isIntegerTy(1) && B->getType()->isIntegerTy(1)) {
----------------
dtcxzyw wrote:

Add support for the vector cases.

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


More information about the llvm-commits mailing list