mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-29 10:25:12 +00:00
Add extra CHECK to make sure that 'or' instruction was replaced.
Also add an assert to avoid confusion in the code where is known that C1 <= C2. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171310 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1528,6 +1528,8 @@ Value *InstCombiner::FoldOrOfICmps(ICmpInst *LHS, ICmpInst *RHS) {
|
||||
if (LHS->getOperand(0) == RHS->getOperand(0)) {
|
||||
// if LHSCst and RHSCst differ only by one bit:
|
||||
// (A == C1 || A == C2) -> (A & ~(C1 ^ C2)) == C1
|
||||
assert(LHSCst->getValue().ule(LHSCst->getValue()));
|
||||
|
||||
APInt Xor = LHSCst->getValue() ^ RHSCst->getValue();
|
||||
if (Xor.isPowerOf2()) {
|
||||
Value *NegCst = Builder->getInt(~Xor);
|
||||
|
Reference in New Issue
Block a user