Skip to content

Commit

Permalink
[NFC] Remove duplicate function calls
Browse files Browse the repository at this point in the history
Removed repeated call of L->getHeader(). Now using previously stored return value.

Patch by Dmitry Makogon!

Differential Revision: https://reviews.llvm.org/D105535
Reviewed By: mkazantsev
  • Loading branch information
xortator committed Jul 7, 2021
1 parent 8ae9ab4 commit 19885c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/Transforms/Scalar/LoopDeletion.cpp
Expand Up @@ -228,7 +228,7 @@ static bool canProveExitOnFirstIteration(Loop *L, DominatorTree &DT,
SmallPtrSet<BasicBlock *, 4> LiveBlocks;
// Edges that are reachable on the 1st iteration.
DenseSet<BasicBlockEdge> LiveEdges;
LiveBlocks.insert(L->getHeader());
LiveBlocks.insert(Header);

SmallPtrSet<BasicBlock *, 4> Visited;
auto MarkLiveEdge = [&](BasicBlock *From, BasicBlock *To) {
Expand Down Expand Up @@ -286,7 +286,7 @@ static bool canProveExitOnFirstIteration(Loop *L, DominatorTree &DT,
// iteration, mark this successor live.
// 3b. If we cannot prove it, conservatively assume that all successors are
// live.
auto &DL = L->getHeader()->getModule()->getDataLayout();
auto &DL = Header->getModule()->getDataLayout();
const SimplifyQuery SQ(DL);
for (auto *BB : RPOT) {
Visited.insert(BB);
Expand Down

0 comments on commit 19885c7

Please sign in to comment.