[llvm] [clang] [InstCombine] Set disjoint flag when turning Add into Or. (PR #72702)

Nikita Popov via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 27 10:46:23 PST 2023


================
@@ -255,8 +255,11 @@ Value *InstCombinerImpl::SimplifyDemandedUseBits(Value *V, APInt DemandedMask,
       return I->getOperand(1);
 
     // If the RHS is a constant, see if we can simplify it.
-    if (ShrinkDemandedConstant(I, 1, DemandedMask))
+    if (ShrinkDemandedConstant(I, 1, DemandedMask)) {
+      // Disjoint flag may not longer hold.
+      I->dropPoisonGeneratingFlags();
       return I;
+    }
----------------
nikic wrote:

Rebase mistake?

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


More information about the cfe-commits mailing list