[PATCH] D37773: Refactor the code to pass down ACT to SampleProfileLoader correctly.

Dehao Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 12 14:57:07 PDT 2017


danielcdh added inline comments.


================
Comment at: lib/Transforms/IPO/SampleProfile.cpp:753
+      CallSite CS(DI);
+      if (InlineFunction(CS, IFI)) {
         LocalChanged = true;
----------------
eraman wrote:
> Any reason why you want a named temporary?
revert, this was in preparation for the follow-up patch.


================
Comment at: lib/Transforms/IPO/SampleProfile.cpp:1486
 bool SampleProfileLoaderLegacyPass::runOnModule(Module &M) {
-  // FIXME: pass in AssumptionCache correctly for the new pass manager.
-  SampleLoader.setACT(&getAnalysis<AssumptionCacheTracker>());
+  ACT = &getAnalysis<AssumptionCacheTracker>();
   return SampleLoader.runOnModule(M, nullptr);
----------------
eraman wrote:
> Since ACT is an immutable pass that doesn't require the module, you can move the initialization of ACT to the constructor  of the legacy pass.
Discussed offline, this need to be here (after calling getAnalysisUsage)


https://reviews.llvm.org/D37773





More information about the llvm-commits mailing list