[llvm] r354118 - [NFC] Promote DFS to field for further use

Max Kazantsev via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 15 03:39:35 PST 2019


Author: mkazantsev
Date: Fri Feb 15 03:39:35 2019
New Revision: 354118

URL: http://llvm.org/viewvc/llvm-project?rev=354118&view=rev
Log:
[NFC] Promote DFS to field for further use

Modified:
    llvm/trunk/lib/Transforms/Scalar/LoopSimplifyCFG.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/LoopSimplifyCFG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopSimplifyCFG.cpp?rev=354118&r1=354117&r2=354118&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopSimplifyCFG.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopSimplifyCFG.cpp Fri Feb 15 03:39:35 2019
@@ -90,6 +90,7 @@ private:
   ScalarEvolution &SE;
   MemorySSAUpdater *MSSAU;
   DomTreeUpdater DTU;
+  LoopBlocksDFS DFS;
   SmallVector<DominatorTree::UpdateType, 16> 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!");




More information about the llvm-commits mailing list