[llvm] [RawProfReader]When constructing symbol table, read the MD5 of function name in the proper byte order (PR #76312)

Mingming Liu via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 23 20:01:30 PST 2023


https://github.com/minglotus-6 created https://github.com/llvm/llvm-project/pull/76312

None

>From 5c142ff889bf9eb9feae8385bd64678de4973838 Mon Sep 17 00:00:00 2001
From: mingmingl <mingmingl at google.com>
Date: Sat, 23 Dec 2023 19:47:48 -0800
Subject: [PATCH] [RawProfReader]Read the MD5 of function name in proper byte
 order

---
 llvm/lib/ProfileData/InstrProfReader.cpp                       | 2 +-
 .../Transforms/PGOProfile/thinlto_indirect_call_promotion.ll   | 3 ---
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/llvm/lib/ProfileData/InstrProfReader.cpp b/llvm/lib/ProfileData/InstrProfReader.cpp
index 8f62df79d5b7e8..b547cf7181b16a 100644
--- a/llvm/lib/ProfileData/InstrProfReader.cpp
+++ b/llvm/lib/ProfileData/InstrProfReader.cpp
@@ -539,7 +539,7 @@ Error RawInstrProfReader<IntPtrT>::createSymtab(InstrProfSymtab &Symtab) {
     const IntPtrT FPtr = swap(I->FunctionPointer);
     if (!FPtr)
       continue;
-    Symtab.mapAddress(FPtr, I->NameRef);
+    Symtab.mapAddress(FPtr, swap(I->NameRef));
   }
   return success();
 }
diff --git a/llvm/test/Transforms/PGOProfile/thinlto_indirect_call_promotion.ll b/llvm/test/Transforms/PGOProfile/thinlto_indirect_call_promotion.ll
index b24effed7024c2..d2f4696ccf41d7 100644
--- a/llvm/test/Transforms/PGOProfile/thinlto_indirect_call_promotion.ll
+++ b/llvm/test/Transforms/PGOProfile/thinlto_indirect_call_promotion.ll
@@ -9,9 +9,6 @@
 ; The raw profiles storesd compressed function names, so profile reader should
 ; be built with zlib support to decompress them.
 ; REQUIRES: zlib
-; REQUIRES: host-byteorder-little-endian
-; Raw profiles are generate on 64-bit systems.
-; REQUIRES: llvm-64-bits
 
 ; RUN: rm -rf %t && split-file %s %t && cd %t
 



More information about the llvm-commits mailing list