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

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 8 11:47:42 PST 2018


fhahn added inline comments.


================
Comment at: include/llvm/Transforms/Scalar/SCCP.h:42-43
 
-bool runIPSCCP(
-    Module &M, const DataLayout &DL, const TargetLibraryInfo *TLI,
-    function_ref<std::unique_ptr<PredicateInfo>(Function &)> getPredicateInfo);
+/// Helper struct for bundling up the analysis per function for IPSCCP.
+struct AnalysisForFn {
+  std::unique_ptr<PredicateInfo> PredInfo;
----------------
chandlerc wrote:
> s/Analysis/AnalysisResults/ ?
Thanks, that makes more sense. I also renamed AnalysisInfo to AnalysisResults in SCCP.cpp


================
Comment at: lib/Transforms/Scalar/SCCP.cpp:2080
       }
 
     }
----------------
brzycki wrote:
> NutshellySima wrote:
> > 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.
> +1 and it also defers a potentially expensive call to `flush()`.
Neat, thank you very much!


https://reviews.llvm.org/D47259





More information about the llvm-commits mailing list