[PATCH] D16015: [PGO] Create the profile data variable before the lowering

David Li via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 15 13:33:53 PST 2016


davidxl added inline comments.

================
Comment at: lib/Transforms/Instrumentation/InstrProfiling.cpp:141
@@ +140,3 @@
+  //
+  // Also create the profile data variable -- do it here because there is no
+  // guarantee that a counter increment will be ahead of value profile
----------------
Remove the comments here.

================
Comment at: lib/Transforms/Instrumentation/InstrProfiling.cpp:154
@@ -144,1 +153,3 @@
           computeNumValueSiteCounts(Ind);
+          hasValueInstrumentation = true;
+        }
----------------
Why is this flag needed?

================
Comment at: lib/Transforms/Instrumentation/InstrProfiling.cpp:161
@@ +160,3 @@
+      assert (FirstProfIncInst != nullptr);
+      getOrCreateRegionCounters(FirstProfIncInst);
+    }
----------------
Add a brief comment here: Value profiling intrinsic lowering requires per-function profile data variable to be created first.


http://reviews.llvm.org/D16015





More information about the llvm-commits mailing list