We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bc64771 commit a26ae44Copy full SHA for a26ae44
llvm/lib/Analysis/ScalarEvolution.cpp
@@ -15867,6 +15867,10 @@ void ScalarEvolution::LoopGuards::collectFromBlock(
15867
if (isa<SCEVConstant>(LHS)) {
15868
std::swap(LHS, RHS);
15869
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);
15874
}
15875
GuardsToProcess.emplace_back(Predicate, LHS, RHS);
15876
continue;
0 commit comments