Skip to content

Commit a26ae44

Browse files
committed
!fixup also move logic to swap unknowns
1 parent bc64771 commit a26ae44

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
@@ -15867,6 +15867,10 @@ void ScalarEvolution::LoopGuards::collectFromBlock(
1586715867
if (isa<SCEVConstant>(LHS)) {
1586815868
std::swap(LHS, RHS);
1586915869
Predicate = CmpInst::getSwappedPredicate(Predicate);
15870+
} else if (!isa<SCEVUnknown>(LHS) && isa<SCEVUnknown>(RHS)) {
15871+
// If RHS is SCEVUnknown, make sure the information is applied to it.
15872+
std::swap(LHS, RHS);
15873+
Predicate = CmpInst::getSwappedPredicate(Predicate);
1587015874
}
1587115875
GuardsToProcess.emplace_back(Predicate, LHS, RHS);
1587215876
continue;

0 commit comments

Comments
 (0)