[llvm] [InstCombine] Fix assertion failure in issue80597 (PR #80614)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 4 11:57:49 PST 2024
================
@@ -801,6 +802,10 @@ Value *InstCombinerImpl::SimplifyDemandedUseBits(Value *V, APInt DemandedMask,
LShr->takeName(I);
return InsertNewInstWith(LShr, I->getIterator());
} else if (Known.One[BitWidth-ShiftAmt-1]) { // New bits are known one.
+ // Sync SignBits with computeKnownBits to make sure there is no
+ // conflict.
+ HighBits = APInt::getHighBitsSet(
+ BitWidth, std::min(MinSignBits + ShiftAmt - 1, BitWidth));
Known.One |= HighBits;
----------------
nikic wrote:
Can we do `Known.Zero &= ~HighBits;` instead?
https://github.com/llvm/llvm-project/pull/80614
More information about the llvm-commits
mailing list