From: Max Kazantsev Date: Fri, 15 Feb 2019 11:39:35 +0000 (+0000) Subject: [NFC] Promote DFS to field for further use X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e45a4d28558206cdc048291bc00a18caf55818fc;p=llvm [NFC] Promote DFS to field for further use git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354118 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/LoopSimplifyCFG.cpp b/lib/Transforms/Scalar/LoopSimplifyCFG.cpp index 746ca9ec31b..40b3306c2c5 100644 --- a/lib/Transforms/Scalar/LoopSimplifyCFG.cpp +++ b/lib/Transforms/Scalar/LoopSimplifyCFG.cpp @@ -90,6 +90,7 @@ private: ScalarEvolution &SE; MemorySSAUpdater *MSSAU; DomTreeUpdater DTU; + LoopBlocksDFS DFS; SmallVector DTUpdates; // Whether or not the current loop has irreducible CFG. @@ -176,7 +177,6 @@ private: /// Fill all information about status of blocks and exits of the current loop /// if constant folding of all branches will be done. void analyze() { - LoopBlocksDFS DFS(&L); DFS.perform(&LI); assert(DFS.isComplete() && "DFS is expected to be finished"); @@ -498,7 +498,7 @@ public: ConstantTerminatorFoldingImpl(Loop &L, LoopInfo &LI, DominatorTree &DT, ScalarEvolution &SE, MemorySSAUpdater *MSSAU) - : L(L), LI(LI), DT(DT), SE(SE), MSSAU(MSSAU), + : L(L), LI(LI), DT(DT), SE(SE), MSSAU(MSSAU), DFS(&L), DTU(DT, DomTreeUpdater::UpdateStrategy::Eager) {} bool run() { assert(L.getLoopLatch() && "Should be single latch!");