[llvm] [Offload][PGO] Fix dump of array in ProfData (PR #122039)

Jinsong Ji via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 11 06:58:41 PST 2025


================
@@ -237,6 +237,9 @@ void GPUProfGlobals::dump() const {
   outs() << "========== Data ===========\n";
   for (const auto &ProfData : Data) {
     outs() << "{ ";
+// The ProfData.Name maybe array, eg: NumValueSites[IPVK_Last+1] .
+// If we print out it directly, we are accessing out of bound data.
+// Skip dumping the array for now.
 #define INSTR_PROF_DATA(Type, LLVMType, Name, Initializer)                     \
   if (sizeof(#Name) > 2 && #Name[sizeof(#Name) - 2] == ']') {                  \
     outs() << " [...]";                                                        \
----------------
jsji wrote:

Oh, you are right. Thanks for the fix!

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


More information about the llvm-commits mailing list