[llvm] 9f5548d - [SPIRV] Preserve DebugGlobalVariable emission order. (#221759)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 8 01:46:41 PDT 2026


Author: Manuel Carrasco
Date: 2026-09-08T09:46:36+01:00
New Revision: 9f5548da33ffdb282225bc03e17c0702c4c31884

URL: https://github.com/llvm/llvm-project/commit/9f5548da33ffdb282225bc03e17c0702c4c31884
DIFF: https://github.com/llvm/llvm-project/commit/9f5548da33ffdb282225bc03e17c0702c4c31884.diff

LOG: [SPIRV] Preserve DebugGlobalVariable emission order. (#221759)

Iterate GlobalVariableDebugInfoMap with MapVector so OpString and
DebugGlobalVariable follow insertion order.

The following tests had non-deterministic output, although didn't fail
due to the use of CHECK-DAG:

- llvm/test/CodeGen/SPIRV/debug-info/debug-global-variable-multi-gve.ll
- llvm/test/CodeGen/SPIRV/debug-info/debug-lexical-block-namespace.ll
- llvm/test/CodeGen/SPIRV/debug-info/debug-type-pointer.ll

Added: 
    

Modified: 
    llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.h b/llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.h
index ecb23450517c7..d0916c104d890 100644
--- a/llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.h
+++ b/llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.h
@@ -101,7 +101,7 @@ class SPIRVNonSemanticDebugHandler : public DebugHandlerBase {
     const DIExpression *Expr = nullptr;
     const GlobalVariable *LLVMGV = nullptr;
   };
-  DenseMap<const DIGlobalVariable *, GlobalVariableDebugInfo>
+  MapVector<const DIGlobalVariable *, GlobalVariableDebugInfo>
       GlobalVariableDebugInfoMap;
 
   // Distinct DILexicalBlock and DINamespace scopes, parent-before-child


        


More information about the llvm-commits mailing list