[llvm] [llvm][asmprinter] Make call graph section deterministic (PR #167400)

Paul Kirth via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 10 13:56:38 PST 2025


https://github.com/ilovepi created https://github.com/llvm/llvm-project/pull/167400

The call-graph-section-assembly.ll tests in CodeGen/X86 and
CodeGen/Aarch64 bot fail under LLVM_REVERSE_ITERATION. These sets should
use SetVector to avoid non-determinism in the ouput.

>From 9fabf9d4fe91f8a91a571393fa2b740e006191b1 Mon Sep 17 00:00:00 2001
From: Paul Kirth <paulkirth at google.com>
Date: Mon, 10 Nov 2025 13:49:41 -0800
Subject: [PATCH] [llvm][asmprinter] Make call graph section deterministic

The call-graph-section-assembly.ll tests in CodeGen/X86 and
CodeGen/Aarch64 bot fail under LLVM_REVERSE_ITERATION. These sets should
use SetVector to avoid non-determinism in the ouput.
---
 llvm/include/llvm/CodeGen/AsmPrinter.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/llvm/include/llvm/CodeGen/AsmPrinter.h b/llvm/include/llvm/CodeGen/AsmPrinter.h
index 9ace2555b4b62..92f2bcc9acef9 100644
--- a/llvm/include/llvm/CodeGen/AsmPrinter.h
+++ b/llvm/include/llvm/CodeGen/AsmPrinter.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/IntrusiveRefCntPtr.h"
 #include "llvm/ADT/MapVector.h"
+#include "llvm/ADT/SetVector.h"
 #include "llvm/ADT/SmallSet.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Analysis/ProfileSummaryInfo.h"
@@ -207,9 +208,9 @@ class LLVM_ABI AsmPrinter : public MachineFunctionPass {
     using CGTypeId = uint64_t;
 
     /// Unique target type IDs.
-    SmallSet<CGTypeId, 4> IndirectCalleeTypeIDs;
+    SetVector<CGTypeId> IndirectCalleeTypeIDs;
     /// Unique direct callees.
-    SmallSet<MCSymbol *, 4> DirectCallees;
+    SetVector<MCSymbol *> DirectCallees;
   };
 
   enum CallGraphSectionFormatVersion : uint8_t {



More information about the llvm-commits mailing list