[PATCH] D21932: [ThinLTO] Perform profile-guided indirect call promotion

David Li via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 11 10:44:51 PDT 2016


davidxl added inline comments.

================
Comment at: include/llvm/IR/ModuleSummaryIndex.h:265
@@ -263,1 +264,3 @@
 
+  /// Record a call graph edge from this function to each function GUID recorded
+  /// in \p CallGraphEdges.
----------------
This is a duplicate.

================
Comment at: lib/Analysis/ModuleSummaryAnalysis.cpp:99
@@ +98,3 @@
+          const CallInst *CI = dyn_cast<CallInst>(&I);
+          if (CS.getCalledValue() && !isa<Constant>(CS.getCalledValue()) &&
+              !(CI && CI->isInlineAsm())) {
----------------
When getCalledValue() returns  constant, should it be covered above (i.e., CalledFunction is not null)?

================
Comment at: lib/Analysis/ModuleSummaryAnalysis.cpp:104
@@ +103,3 @@
+            auto CandidateProfileData =
+                ICallAnalysis.getPromotionCandidatesForInstruction(
+                    &I, NumVals, TotalCount, NumCandidates);
----------------
See the comment in the dependent patch -- the icall analysis needs to return set of targets also 'legal'.

================
Comment at: lib/Bitcode/Writer/BitcodeWriter.cpp:151
@@ +150,3 @@
+    if (Index)
+      for (const auto &I : *Index)
+        for (auto &S : I.second)
----------------
Add one line comment before each 'for' -- kind of hard to read a loop deep nested without some background.


http://reviews.llvm.org/D21932





More information about the llvm-commits mailing list