Skip to content

Commit 2889778

Browse files
committed
adjust
1 parent db77078 commit 2889778

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,13 +699,14 @@ Value *InstCombinerImpl::simplifyRangeCheck(ICmpInst *Cmp0, ICmpInst *Cmp1,
699699
Value *Cmp1Op1 = Cmp1->getOperand(1);
700700
Value *RangeEnd;
701701
if (match(Cmp1Op0, m_SExtOrSelf(m_Specific(Input)))) {
702+
// For the upper range compare we have: icmp x, n
702703
Input = Cmp1Op0;
703704
RangeEnd = Cmp1Op1;
704705
} else if (match(Cmp1Op1, m_SExtOrSelf(m_Specific(Input)))) {
705706
// For the upper range compare we have: icmp n, (sext x)
706-
Pred1 = ICmpInst::getSwappedPredicate(Pred1);
707707
Input = Cmp1Op1;
708708
RangeEnd = Cmp1Op0;
709+
Pred1 = ICmpInst::getSwappedPredicate(Pred1);
709710
} else {
710711
return nullptr;
711712
}

0 commit comments

Comments
 (0)