[llvm] [IR] Add disjoint flag for Or instructions. (PR #72583)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 20 05:48:39 PST 2023


================
@@ -231,8 +231,11 @@ Value *InstCombinerImpl::SimplifyDemandedUseBits(Value *V, APInt DemandedMask,
     // If either the LHS or the RHS are One, the result is One.
     if (SimplifyDemandedBits(I, 1, DemandedMask, RHSKnown, Depth + 1) ||
         SimplifyDemandedBits(I, 0, DemandedMask & ~RHSKnown.One, LHSKnown,
-                             Depth + 1))
+                             Depth + 1)) {
+      // Disjoint flag may not longer hold.
+      I->dropPoisonGeneratingFlags();
----------------
nikic wrote:

Can you please also add a test for this?

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


More information about the llvm-commits mailing list