[llvm] 86eb6bf - [LowerTypeTests] Use MapVector to stabilize iteration order

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 19 15:11:31 PDT 2024


Author: Fangrui Song
Date: 2024-06-19T15:11:25-07:00
New Revision: 86eb6bf6715c87425284902fe9e2e41e86937f23

URL: https://github.com/llvm/llvm-project/commit/86eb6bf6715c87425284902fe9e2e41e86937f23
DIFF: https://github.com/llvm/llvm-project/commit/86eb6bf6715c87425284902fe9e2e41e86937f23.diff

LOG: [LowerTypeTests] Use MapVector to stabilize iteration order

Otherwise llvm/test/LTO/X86/cfi_jt_aliases.ll could fail when
DenseMapInfo<StringRef> changes.

Added: 
    

Modified: 
    llvm/lib/Transforms/IPO/LowerTypeTests.cpp
    llvm/test/LTO/X86/cfi_jt_aliases.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/LowerTypeTests.cpp b/llvm/lib/Transforms/IPO/LowerTypeTests.cpp
index f86f217bca588..9a78c77f8f28d 100644
--- a/llvm/lib/Transforms/IPO/LowerTypeTests.cpp
+++ b/llvm/lib/Transforms/IPO/LowerTypeTests.cpp
@@ -2074,7 +2074,7 @@ bool LowerTypeTestsModule::lower() {
     CfiFunctionLinkage Linkage;
     MDNode *FuncMD; // {name, linkage, type[, type...]}
   };
-  DenseMap<StringRef, ExportedFunctionInfo> ExportedFunctions;
+  MapVector<StringRef, ExportedFunctionInfo> ExportedFunctions;
   if (ExportSummary) {
     // A set of all functions that are address taken by a live global object.
     DenseSet<GlobalValue::GUID> AddressTaken;

diff  --git a/llvm/test/LTO/X86/cfi_jt_aliases.ll b/llvm/test/LTO/X86/cfi_jt_aliases.ll
index 9d114f4b78614..c58d2cc020872 100644
--- a/llvm/test/LTO/X86/cfi_jt_aliases.ll
+++ b/llvm/test/LTO/X86/cfi_jt_aliases.ll
@@ -22,9 +22,9 @@
 ; CHECK-FULL-RE-NEXT: FUNC LOCAL DEFAULT {{[0-9]+}} b.cfi_jt
 ; CHECK-FULL-RE-NEXT: FUNC LOCAL DEFAULT {{[0-9]+}} c.cfi_jt
 
-; CHECK-THIN-RE:      FUNC GLOBAL HIDDEN {{[0-9]+}} b.cfi_jt
+; CHECK-THIN-RE:      FUNC GLOBAL HIDDEN {{[0-9]+}} a.cfi_jt
+; CHECK-THIN-RE-NEXT: FUNC GLOBAL HIDDEN {{[0-9]+}} b.cfi_jt
 ; CHECK-THIN-RE-NEXT: FUNC GLOBAL HIDDEN {{[0-9]+}} c.cfi_jt
-; CHECK-THIN-RE-NEXT: FUNC GLOBAL HIDDEN {{[0-9]+}} a.cfi_jt
 
 ; CHECK-FULL-OD:      a.cfi_jt>:
 ; CHECK-FULL-OD:      jmp {{.*}} <a.cfi_jt
@@ -36,15 +36,15 @@
 ; CHECK-FULL-OD:      jmp {{.*}} <c.cfi_jt
 ; CHECK-FULL-OD-NEXT: R_X86_64_PLT32 .Lc$local
 
+; CHECK-THIN-OD:      a.cfi_jt>:
+; CHECK-THIN-OD:      jmp {{.*}} <a.cfi_jt
+; CHECK-THIN-OD-NEXT: R_X86_64_PLT32 a
 ; CHECK-THIN-OD:      b.cfi_jt>:
 ; CHECK-THIN-OD:      jmp {{.*}} <b.cfi_jt
 ; CHECK-THIN-OD-NEXT: R_X86_64_PLT32 b
 ; CHECK-THIN-OD:      c.cfi_jt>:
 ; CHECK-THIN-OD:      jmp {{.*}} <c.cfi_jt
 ; CHECK-THIN-OD-NEXT: R_X86_64_PLT32 c
-; CHECK-THIN-OD:      a.cfi_jt>:
-; CHECK-THIN-OD:      jmp {{.*}} <a.cfi_jt
-; CHECK-THIN-OD-NEXT: R_X86_64_PLT32 a
 
 ; CHECK-USED: @llvm.used = appending global [3 x ptr] [ptr @a.cfi_jt, ptr @b.cfi_jt, ptr @c.cfi_jt], section "llvm.metadata"
 


        


More information about the llvm-commits mailing list