[PATCH] LLVM changes for indirect call target profiling support

David davidxl at google.com
Sat May 16 11:16:14 PDT 2015


A couple of more comments:


================
Comment at: lib/Transforms/Instrumentation/InstrProfiling.cpp:58
@@ +57,3 @@
+    PerFunctionProfileData() : RegionCounters(nullptr), DataVar(nullptr) {
+      NumValueSites[instr_value_prof_kind::last-1] = {0};
+    }
----------------
use memset.

================
Comment at: lib/Transforms/Instrumentation/InstrProfiling.cpp:138
@@ -122,1 +137,3 @@
 
+  // We did not know how many value sites there would be inside
+  // the instrumented function. This is counting the number of instrumented
----------------
Can this loop merged with the LowerInstrumentTargetInst loop below? The later does not seem to depend on NumvalueSites value which is used at runtime.

================
Comment at: lib/Transforms/Instrumentation/InstrProfiling.cpp:320
@@ +319,3 @@
+      ConstantExpr::getBitCast(Inc->getParent()->getParent(), Int8PtrTy),
+      ConstantInt::get(Int32Ty,
+        PD.NumValueSites[instr_value_prof_kind::indirect_call_target]),
----------------
Reserve space for future kinds.

http://reviews.llvm.org/D8908

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list