[compiler-rt] [llvm] Reland "[TypeProf][InstrPGO] Introduce raw and instr profile format change for type profiling." (PR #82711)

via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 22 16:15:23 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 300425cea51ef566a4d38e57afd9a7ae8024a682 90bdd0d60508c92412ad47d80bb1c9e8e6e35354 -- compiler-rt/include/profile/InstrProfData.inc compiler-rt/lib/profile/InstrProfiling.h compiler-rt/lib/profile/InstrProfilingBuffer.c compiler-rt/lib/profile/InstrProfilingFile.c compiler-rt/lib/profile/InstrProfilingInternal.h compiler-rt/lib/profile/InstrProfilingMerge.c compiler-rt/lib/profile/InstrProfilingPlatformAIX.c compiler-rt/lib/profile/InstrProfilingPlatformDarwin.c compiler-rt/lib/profile/InstrProfilingPlatformLinux.c compiler-rt/lib/profile/InstrProfilingPlatformOther.c compiler-rt/lib/profile/InstrProfilingPlatformWindows.c compiler-rt/lib/profile/InstrProfilingWriter.c compiler-rt/test/profile/instrprof-write-buffer-internal.c llvm/include/llvm/ProfileData/InstrProf.h llvm/include/llvm/ProfileData/InstrProfData.inc llvm/include/llvm/ProfileData/InstrProfReader.h llvm/lib/ProfileData/InstrProf.cpp llvm/lib/ProfileData/InstrProfReader.cpp llvm/lib/ProfileData/InstrProfWriter.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/compiler-rt/lib/profile/InstrProfilingPlatformAIX.c b/compiler-rt/lib/profile/InstrProfilingPlatformAIX.c
index 415d728871..b9d51b698b 100644
--- a/compiler-rt/lib/profile/InstrProfilingPlatformAIX.c
+++ b/compiler-rt/lib/profile/InstrProfilingPlatformAIX.c
@@ -198,8 +198,10 @@ static int dummy_vnds[0] COMPILER_RT_SECTION(
     COMPILER_RT_SEG INSTR_PROF_VNODES_SECT_NAME);
 static int dummy_orderfile[0] COMPILER_RT_SECTION(
     COMPILER_RT_SEG INSTR_PROF_ORDERFILE_SECT_NAME);
-static int dummy_vname[0] COMPILER_RT_SECTION(COMPILER_RT_SEG INSTR_PROF_VNAME_SECT_NAME);
-static int dummy_vtab[0] COMPILER_RT_SECTION(COMPILER_RT_SEG INSTR_PROF_VTAB_SECT_NAME);
+static int dummy_vname[0] COMPILER_RT_SECTION(
+    COMPILER_RT_SEG INSTR_PROF_VNAME_SECT_NAME);
+static int dummy_vtab[0] COMPILER_RT_SECTION(
+    COMPILER_RT_SEG INSTR_PROF_VTAB_SECT_NAME);
 
 // To avoid GC'ing of the dummy variables by the linker, reference them in an
 // array and reference the array in the runtime registration code
@@ -209,10 +211,10 @@ static int dummy_vtab[0] COMPILER_RT_SECTION(COMPILER_RT_SEG INSTR_PROF_VTAB_SEC
 #pragma GCC diagnostic ignored "-Wcast-qual"
 #endif
 COMPILER_RT_VISIBILITY
-void *__llvm_profile_keep[] = {(void *)&dummy_cnts, (void *)&dummy_bits,
-                               (void *)&dummy_data, (void *)&dummy_name,
-                               (void *)&dummy_vnds, (void *)&dummy_orderfile,
-                               (void *)&dummy_vname, (void* )&dummy_vtab};
+void *__llvm_profile_keep[] = {(void *)&dummy_cnts,  (void *)&dummy_bits,
+                               (void *)&dummy_data,  (void *)&dummy_name,
+                               (void *)&dummy_vnds,  (void *)&dummy_orderfile,
+                               (void *)&dummy_vname, (void *)&dummy_vtab};
 #ifdef __GNUC__
 #pragma GCC diagnostic pop
 #endif
diff --git a/compiler-rt/lib/profile/InstrProfilingPlatformOther.c b/compiler-rt/lib/profile/InstrProfilingPlatformOther.c
index f40cf36a1f..37d7819f77 100644
--- a/compiler-rt/lib/profile/InstrProfilingPlatformOther.c
+++ b/compiler-rt/lib/profile/InstrProfilingPlatformOther.c
@@ -18,12 +18,12 @@
 
 static const __llvm_profile_data *DataFirst = NULL;
 static const __llvm_profile_data *DataLast = NULL;
-static const VTableProfData* VTableProfDataFirst = NULL;
-static const VTableProfData* VTableProfDataLast = NULL;
+static const VTableProfData *VTableProfDataFirst = NULL;
+static const VTableProfData *VTableProfDataLast = NULL;
 static const char *NamesFirst = NULL;
 static const char *NamesLast = NULL;
-static const char* VNamesFirst = NULL;
-sttatic const char* VNamesLast = NULL;
+static const char *VNamesFirst = NULL;
+sttatic const char *VNamesLast = NULL;
 static char *CountersFirst = NULL;
 static char *CountersLast = NULL;
 static uint32_t *OrderFileFirst = NULL;
@@ -84,10 +84,11 @@ COMPILER_RT_VISIBILITY
 const __llvm_profile_data *__llvm_profile_begin_data(void) { return DataFirst; }
 COMPILER_RT_VISIBILITY
 const __llvm_profile_data *__llvm_profile_end_data(void) { return DataLast; }
-COMPILER_RT_VISIBILITY const VTableProfData* __llvm_profile_begin_vtables(void) {
+COMPILER_RT_VISIBILITY const VTableProfData *
+__llvm_profile_begin_vtables(void) {
   return VTableProfDataFirst;
 }
-COMPILER_RT_VISIBILITY const VTableProfData* __llvm_profile_end_vtables(void) {
+COMPILER_RT_VISIBILITY const VTableProfData *__llvm_profile_end_vtables(void) {
   return VTableProfDataLast;
 }
 COMPILER_RT_VISIBILITY
@@ -95,8 +96,8 @@ const char *__llvm_profile_begin_names(void) { return NamesFirst; }
 COMPILER_RT_VISIBILITY
 const char *__llvm_profile_end_names(void) { return NamesLast; }
 COMPILER_RT_VISIBILITY
-const char* __llvm_profile_begin_vtabnames(void) { return VNamesFirst; }
-const char* __llvm_profile_end_vtabnames(void) { return VNamesLast; }
+const char *__llvm_profile_begin_vtabnames(void) { return VNamesFirst; }
+const char *__llvm_profile_end_vtabnames(void) { return VNamesLast; }
 COMPILER_RT_VISIBILITY
 char *__llvm_profile_begin_counters(void) { return CountersFirst; }
 COMPILER_RT_VISIBILITY
diff --git a/compiler-rt/lib/profile/InstrProfilingPlatformWindows.c b/compiler-rt/lib/profile/InstrProfilingPlatformWindows.c
index 4626f262e7..5e2d8c87a9 100644
--- a/compiler-rt/lib/profile/InstrProfilingPlatformWindows.c
+++ b/compiler-rt/lib/profile/InstrProfilingPlatformWindows.c
@@ -60,19 +60,15 @@ const __llvm_profile_data *__llvm_profile_begin_data(void) {
 const __llvm_profile_data *__llvm_profile_end_data(void) { return &DataEnd; }
 
 // TODO: Implement the linker magic on Windows.
-const VTableProfData* __llvm_profile_begin_vtables(void) {
-  return NULL;
-}
+const VTableProfData *__llvm_profile_begin_vtables(void) { return NULL; }
 
-const VTableProfData* __llvm_profile_end_vtables(void) {
-  return NULL;
-}
+const VTableProfData *__llvm_profile_end_vtables(void) { return NULL; }
 
 const char *__llvm_profile_begin_names(void) { return &NamesStart + 1; }
 const char *__llvm_profile_end_names(void) { return &NamesEnd; }
 
-const char* __llvm_profile_begin_vtabnames(void) { return NULL; }
-const char* __llvm_profile_end_vtabnames(void) { return NULL; }
+const char *__llvm_profile_begin_vtabnames(void) { return NULL; }
+const char *__llvm_profile_end_vtabnames(void) { return NULL; }
 
 char *__llvm_profile_begin_counters(void) { return &CountersStart + 1; }
 char *__llvm_profile_end_counters(void) { return &CountersEnd; }

``````````

</details>


https://github.com/llvm/llvm-project/pull/82711


More information about the llvm-commits mailing list