[PATCH] D47259: [IPSCCP,PM] Preserve DT in the new pass manager.

Chijun Sima via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 8 10:24:15 PST 2018


NutshellySima added inline comments.


================
Comment at: lib/Transforms/IPO/SCCP.cpp:24
+  PreservedAnalyses PA;
+  PA.preserve<DominatorTreeAnalysis>();
+  PA.preserve<FunctionAnalysisManagerModuleProxy>();
----------------
It is also possible to preserve PostDominatorTree here trivially using `DTU(DT, PDT, ...)` and `auto* PDT = FAM.getCachedResult`.


================
Comment at: lib/Transforms/Scalar/SCCP.cpp:2080
       }
 
     }
----------------
I would suggest using `DTU.deleteBB(DeadBB)` here which delays BB removal until `flush()` and removing 
```
for (BasicBlock *DeadBB : BlocksToErase)
      F.getBasicBlockList().erase(DeadBB);
```
below.
I believe it would make the code more readable.


https://reviews.llvm.org/D47259





More information about the llvm-commits mailing list