mirror of
https://github.com/intel/llvm.git
synced 2026-01-21 12:19:23 +08:00
Grammo.
llvm-svn: 171272
This commit is contained in:
@@ -1526,7 +1526,7 @@ Value *InstCombiner::FoldOrOfICmps(ICmpInst *LHS, ICmpInst *RHS) {
|
||||
}
|
||||
|
||||
if (LHS->getOperand(0) == RHS->getOperand(0)) {
|
||||
// if LHSCst and RHSCst differ with only one bit:
|
||||
// if LHSCst and RHSCst differ only by one bit:
|
||||
// (A == C1 || A == C2) -> (A & ~(C1 ^ C2)) == C1
|
||||
APInt Xor = LHSCst->getValue() ^ RHSCst->getValue();
|
||||
if (Xor.isPowerOf2()) {
|
||||
|
||||
Reference in New Issue
Block a user