[PATCH] D76802: [InstrProfiling] Use !associated metadata for counters, data and values

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 28 15:59:28 PDT 2020


davidxl added a comment.

What is the instrumented size improvement for Clang? How about profile size reduction?



================
Comment at: compiler-rt/lib/profile/InstrProfilingPlatformLinux.c:37
+extern ValueProfNode PROF_VNODES_START COMPILER_RT_VISIBILITY COMPILER_RT_WEAK;
+extern ValueProfNode PROF_VNODES_STOP COMPILER_RT_VISIBILITY COMPILER_RT_WEAK;
 
----------------
why adding the weak attribute ?


================
Comment at: compiler-rt/lib/profile/InstrProfilingPlatformLinux.c:40
-/* Add dummy data to ensure the section is always created. */
-__llvm_profile_data
-    __prof_data_sect_data[0] COMPILER_RT_SECTION(INSTR_PROF_DATA_SECT_NAME);
----------------
what is this change for?


================
Comment at: compiler-rt/test/profile/instrprof-gc-sections.c:3
+
+// RUN: %clang_profgen=%t.profraw -fuse-ld=lld -fcoverage-mapping -mllvm -enable-name-compression=false -DCODE=1 -ffunction-sections -fdata-sections -Wl,--gc-sections -o %t %s
+// RUN: %run %t
----------------
Also check IR PGO?


================
Comment at: compiler-rt/test/profile/instrprof-gc-sections.c:72
+// PRF_CNTS: Hex dump of section '__llvm_prf_cnts':
+// PRF_CNTS-NEXT: {{.*}} 00000000 00000000 {{.*$}}
----------------
Explain the expected output here?


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

https://reviews.llvm.org/D76802





More information about the llvm-commits mailing list