Skip to content

Commit 6893dad

Browse files
committed
!fixup also move logic to swap unknowns
1 parent 8605517 commit 6893dad

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/lib/Analysis/ScalarEvolution.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15862,6 +15862,10 @@ void ScalarEvolution::LoopGuards::collectFromBlock(
1586215862
if (isa<SCEVConstant>(LHS)) {
1586315863
std::swap(LHS, RHS);
1586415864
Predicate = CmpInst::getSwappedPredicate(Predicate);
15865+
} else if (!isa<SCEVUnknown>(LHS) && isa<SCEVUnknown>(RHS)) {
15866+
// If RHS is SCEVUnknown, make sure the information is applied to it.
15867+
std::swap(LHS, RHS);
15868+
Predicate = CmpInst::getSwappedPredicate(Predicate);
1586515869
}
1586615870
GuardsToProcess.emplace_back(Predicate, LHS, RHS);
1586715871
continue;

0 commit comments

Comments
 (0)