[PATCH] D8940: Clang changes for indirect call target profiling

David Li via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 20 13:40:53 PST 2016


davidxl added inline comments.

================
Comment at: lib/CodeGen/CodeGenPGO.cpp:768
@@ +767,3 @@
+  llvm::IndexedInstrProfReader *PGOReader = CGM.getPGOReader();
+  if (!InstrumentValueSites && !PGOReader)
+    return;
----------------
&& --> ||

================
Comment at: lib/CodeGen/CodeGenPGO.cpp:782
@@ +781,3 @@
+    Builder.CreateCall(
+      CGM.getIntrinsic(llvm::Intrinsic::instrprof_value_profile), Args);
+  }
----------------
add return here?

================
Comment at: lib/CodeGen/CodeGenPGO.cpp:813
@@ +812,3 @@
+      Vals.push_back(MDHelper.createString(
+          getRawFuncName(Symtab.getFuncName(VD[I].Value))));
+      Vals.push_back(MDHelper.createConstant(
----------------
Why not pushing the mapping to string to the user (transformation)? Annotating IR with long strings can bloat the IR size a bit. There is also a symtab create interface added which takes module as input which is way more efficient (do not need to walk through the whole profiile data)


http://reviews.llvm.org/D8940





More information about the cfe-commits mailing list