[PATCH] D28966: [PGO] Memory intrinsic calls optimization based on profiled size

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 20 16:58:32 PDT 2017


davidxl added inline comments.


================
Comment at: lib/Transforms/Instrumentation/IndirectCallPromotion.cpp:789
+
+enum MemOPSizeKind { PreciseValue, NormalGroup, LargeGroup };
+static MemOPSizeKind getMemOPSizeKind(int64_t Value) {
----------------
Add a comment on the kinds.

NormalGroup--> NonLargeGroup?


================
Comment at: lib/Transforms/Instrumentation/IndirectCallPromotion.cpp:794
+  static bool OptionHandled = false;
+  if (!OptionHandled) {
+    getMemOPSizeRangeFromOption(MemOPSizeRange, PreciseRangeStart,
----------------
Is it correct to guard the parsing here?

Should the parsing be called at the start of the pass with PreciseStart etc as a member variable?


================
Comment at: lib/Transforms/Instrumentation/IndirectCallPromotion.cpp:824
+  // Keeping track of the count of the default case:
+  uint64_t DC = TotalCount;
+
----------------
DC --> RemainCount?


================
Comment at: lib/Transforms/Instrumentation/IndirectCallPromotion.cpp:843
+
+    uint64_t PercentThreshold = DC * MemOPPercentThreshold / 100;
+    if (C < PercentThreshold)
----------------
Should it use TotalCount here?


https://reviews.llvm.org/D28966





More information about the llvm-commits mailing list