Skip to content

Commit

Permalink
[SCEV] Address post-commit comments for llvm#113915.
Browse files Browse the repository at this point in the history
Address post-commit comments for
llvm#113915.
  • Loading branch information
fhahn committed Nov 17, 2024
1 parent ec950b2 commit feb9b37
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion llvm/include/llvm/Analysis/ScalarEvolution.h
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,7 @@ class ScalarEvolution {
/// Collect loop guards in \p Guards, starting from PHINode \p
/// Phi, by calling \p collectFromBlock on the incoming blocks of
/// \Phi and trying to merge the found constraints into a single
/// combined on for \p Phi.
/// combined one for \p Phi.
static void collectFromPHI(
ScalarEvolution &SE, ScalarEvolution::LoopGuards &Guards,
const PHINode &Phi, SmallPtrSetImpl<const BasicBlock *> &VisitedBlocks,
Expand Down
10 changes: 5 additions & 5 deletions llvm/lib/Analysis/ScalarEvolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15274,17 +15274,17 @@ void ScalarEvolution::LoopGuards::collectFromPHI(
if (Inserted)
collectFromBlock(SE, G->second, Phi.getParent(), InBlock, VisitedBlocks,
Depth + 1);
auto S = G->second.RewriteMap.find(
SE.getSCEV(Phi.getIncomingValue(IncomingIdx)));
if (S == G->second.RewriteMap.end())
auto &RewriteMap = G->second.RewriteMap;
if (RewriteMap.empty())
return {nullptr, scCouldNotCompute};
auto S = RewriteMap.find(SE.getSCEV(Phi.getIncomingValue(IncomingIdx)));
if (S == RewriteMap.end())
return {nullptr, scCouldNotCompute};
auto *SM = dyn_cast_if_present<SCEVMinMaxExpr>(S->second);
if (!SM)
return {nullptr, scCouldNotCompute};
if (const SCEVConstant *C0 = dyn_cast<SCEVConstant>(SM->getOperand(0)))
return {C0, SM->getSCEVType()};
if (const SCEVConstant *C1 = dyn_cast<SCEVConstant>(SM->getOperand(1)))
return {C1, SM->getSCEVType()};
return {nullptr, scCouldNotCompute};
};
auto MergeMinMaxConst = [](MinMaxPattern P1,
Expand Down

0 comments on commit feb9b37

Please sign in to comment.