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 696b78f commit 7e0c2ddCopy full SHA for 7e0c2dd
llvm/lib/Analysis/ScalarEvolution.cpp
@@ -15877,6 +15877,10 @@ void ScalarEvolution::LoopGuards::collectFromBlock(
15877
if (isa<SCEVConstant>(LHS)) {
15878
std::swap(LHS, RHS);
15879
Predicate = CmpInst::getSwappedPredicate(Predicate);
15880
+ } else if (!isa<SCEVUnknown>(LHS) && isa<SCEVUnknown>(RHS)) {
15881
+ // If RHS is SCEVUnknown, make sure the information is applied to it.
15882
+ std::swap(LHS, RHS);
15883
+ Predicate = CmpInst::getSwappedPredicate(Predicate);
15884
}
15885
GuardsToProcess.emplace_back(Predicate, LHS, RHS);
15886
continue;
0 commit comments