[PATCH] D22491: Added ThinLTO inlining statistics

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 26 09:21:59 PDT 2016


tejohnson added inline comments.

================
Comment at: lib/Transforms/IPO/Inliner.cpp:100
@@ -81,1 +99,3 @@
+    ImportedFunctionsInliningStatistics &ImportedFunctionsStats) {
+  // Storing because call getCalledFunction() and getCaller() after inlining.
   Function *Callee = CS.getCalledFunction();
----------------
New comment doesn't make sense. I think you missed a word or two? Maybe:
"Storing because getCalledFunction() and getCaller() are not accessible after inlining, due to call instruction being eliminated."

================
Comment at: lib/Transforms/Utils/ImportedFunctionsInliningStatistics.cpp:104
@@ +103,3 @@
+    if (Node.second.Imported) {
+      InlinedImportedFunctionsCount += int(Node.second.NumberOfInlines > 0);
+      InlinedImportedFunctionsToImportingModuleCount +=
----------------
As Easwaran mentioned, due to the earlier check/continue, you are guaranteed that NumberOfInlines > 0. So simply change this to a ++.

================
Comment at: lib/Transforms/Utils/ImportedFunctionsInliningStatistics.cpp:108
@@ +107,3 @@
+    } else {
+      InlinedNotImportedFunctionsCount += int(Node.second.NumberOfInlines > 0);
+      InlinedNotImportedFunctionsToImportingModuleCount +=
----------------
Ditto.

================
Comment at: lib/Transforms/Utils/ImportedFunctionsInliningStatistics.cpp:139
@@ +138,3 @@
+                           ImportedFunctions, "imported functions",
+                           /*NewLinefalse=*/false)
+          << getStatString(", left", ImportedNotInlinedIntoModule,
----------------
s/NewLinefalse/LineEnd/


https://reviews.llvm.org/D22491





More information about the llvm-commits mailing list