[PATCH] D28966: [PGO] Memory intrinsic calls optimization based on profiled size
David Li via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 30 20:32:08 PDT 2017
davidxl added inline comments.
================
Comment at: lib/Transforms/Instrumentation/IndirectCallPromotion.cpp:834
+
+static inline uint64_t getScaledCount(uint64_t Count, uint64_t Num,
+ uint64_t Denom) {
----------------
Use APInt or SaturatingMultipleAdd to deal with possible overflow.
================
Comment at: lib/Transforms/Instrumentation/IndirectCallPromotion.cpp:849
+
+ if (TotalCount < MemOPCountThreshold)
+ return false;
----------------
Should check the actual count.
================
Comment at: lib/Transforms/Instrumentation/IndirectCallPromotion.cpp:883
+ if (MemOPScaleCount)
+ C = getScaledCount(C, ActualCount, SavedTotalCount);
+
----------------
can shrink the MemOpScaleCount check into getScaledCount
https://reviews.llvm.org/D28966
More information about the llvm-commits
mailing list