Skip to content

Commit 19885c7

Browse files
committed
[NFC] Remove duplicate function calls
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
1 parent 8ae9ab4 commit 19885c7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/Scalar/LoopDeletion.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ static bool canProveExitOnFirstIteration(Loop *L, DominatorTree &DT,
228228
SmallPtrSet<BasicBlock *, 4> LiveBlocks;
229229
// Edges that are reachable on the 1st iteration.
230230
DenseSet<BasicBlockEdge> LiveEdges;
231-
LiveBlocks.insert(L->getHeader());
231+
LiveBlocks.insert(Header);
232232

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

0 commit comments

Comments
 (0)