[PATCH] D51467: Output per-function size-info remarks

Francis Visoiu Mistrih via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 30 05:43:34 PDT 2018


thegameg accepted this revision.
thegameg added a comment.
This revision is now accepted and ready to land.

Other than the comments it LGTM, thanks!



================
Comment at: lib/IR/LegacyPassManager.cpp:191
+      std::pair<unsigned, unsigned> ChangePair(0, FnSize);
+      FunctionToInstrCount.insert(
+          std::make_pair(F.getName().str(), ChangePair));
----------------
Why not `FunctionToInstrCount[F.getName().str()] = std::pair<unsigned, unsigned>(0, FnSize);` as used previously in `initSizeRemarkInfo`?


================
Comment at: lib/IR/LegacyPassManager.cpp:238
+    OptimizationRemarkAnalysis FR("size-info", "FunctionIRSizeChange",
+                                  DiagnosticLocation(), &BB);
+    unsigned FnCountBefore, FnCountAfter;
----------------
You may be able to avoid using `BB` by calling the `DiagnosticInfoIROptimization` constructor directly.


https://reviews.llvm.org/D51467





More information about the llvm-commits mailing list