mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 18:24:00 +00:00
Fix a bogus srem rule - a negative value srem'd by a power-of-2
can have a non-negative result; for example, -16%16 is 0. Also, clarify the related comments. This fixes PR2670. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54767 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1266,11 +1266,8 @@ bool InstCombiner::SimplifyDemandedBits(Value *V, APInt DemandedMask,
|
||||
|
||||
if (LHSKnownZero[BitWidth-1] || ((LHSKnownZero & LowBits) == LowBits))
|
||||
LHSKnownZero |= ~LowBits;
|
||||
else if (LHSKnownOne[BitWidth-1])
|
||||
LHSKnownOne |= ~LowBits;
|
||||
|
||||
KnownZero |= LHSKnownZero & DemandedMask;
|
||||
KnownOne |= LHSKnownOne & DemandedMask;
|
||||
|
||||
assert((KnownZero & KnownOne) == 0&&"Bits known to be one AND zero?");
|
||||
}
|
||||
|
Reference in New Issue
Block a user