[PATCH] D81682: [PGO] Extend the value profile buckets for mem op sizes.

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 7 20:20:51 PDT 2020


davidxl added inline comments.


================
Comment at: compiler-rt/include/profile/InstrProfData.inc:839
+#if defined(_MSC_VER) && !defined(__clang__)
+
+#include <intrin.h>
----------------
There is __popcnt etc. Can they be used?

https://docs.microsoft.com/en-us/cpp/intrinsics/popcnt16-popcnt-popcnt64?view=vs-2019


================
Comment at: compiler-rt/include/profile/InstrProfData.inc:842
+INSTR_PROF_VISIBILITY INSTR_PROF_INLINE
+int InstProfClzll(unsigned long long X) {
+  unsigned long LeadZeroIdx = 0;
----------------
Since these helpers are only used by runtime on target, not by the host compiler, they should be moved to InstrProfilingUtil.c instead as InstrProfData.Inc is shared by runtime and compiler.


================
Comment at: compiler-rt/lib/profile/InstrProfilingValue.c:274
+COMPILER_RT_VISIBILITY void
+__llvm_profile_instrument_memop(uint64_t TargetValue, void *Data,
+                                uint32_t CounterIndex) {
----------------
Ideally, this function should be inline expanded by the compiler at instrumentation time -- but that can be done separately.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81682/new/

https://reviews.llvm.org/D81682





More information about the llvm-commits mailing list