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 8605517 commit 6893dadCopy full SHA for 6893dad
llvm/lib/Analysis/ScalarEvolution.cpp
@@ -15862,6 +15862,10 @@ void ScalarEvolution::LoopGuards::collectFromBlock(
15862
if (isa<SCEVConstant>(LHS)) {
15863
std::swap(LHS, RHS);
15864
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);
15869
}
15870
GuardsToProcess.emplace_back(Predicate, LHS, RHS);
15871
continue;
0 commit comments