diff --git a/llvm/lib/Transforms/Scalar/LoopDeletion.cpp b/llvm/lib/Transforms/Scalar/LoopDeletion.cpp --- a/llvm/lib/Transforms/Scalar/LoopDeletion.cpp +++ b/llvm/lib/Transforms/Scalar/LoopDeletion.cpp @@ -228,7 +228,7 @@ SmallPtrSet LiveBlocks; // Edges that are reachable on the 1st iteration. DenseSet LiveEdges; - LiveBlocks.insert(L->getHeader()); + LiveBlocks.insert(Header); SmallPtrSet Visited; auto MarkLiveEdge = [&](BasicBlock *From, BasicBlock *To) { @@ -286,7 +286,7 @@ // 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);