Files
nixpkgs/pkgs/development/rocm-modules/6/llvm/perf-increase-namestring-size.patch
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

29 lines
1.1 KiB
Diff

From a57eb548d46a37e4aed33eefccc9e6374b579ff9 Mon Sep 17 00:00:00 2001
From: Luna Nova <git@lunnova.dev>
Date: Mon, 16 Dec 2024 13:58:54 -0800
Subject: [PATCH] [AMDGPU] TargetMachine: increase NameString size to 256
128 is too small a default for compilers used to build
AMD's rocBLAS, composable_kernel and similar libs because
they use very long symbol names such as
device_gemm_xdl_universal_bf16_bf16_bf16_mk_nk_mn_comp_default_instance
This fixes spending ~10% of compile time in malloc inside this function.
---
llvm/lib/Target/TargetMachine.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/lib/Target/TargetMachine.cpp b/llvm/lib/Target/TargetMachine.cpp
index abd0fdf2390c0..86ce468b75643 100644
--- a/lib/Target/TargetMachine.cpp
+++ b/lib/Target/TargetMachine.cpp
@@ -270,7 +270,7 @@ MCSymbol *TargetMachine::getSymbol(const GlobalValue *GV) const {
if (MCSymbol *TargetSymbol = TLOF->getTargetSymbol(GV, *this))
return TargetSymbol;
- SmallString<128> NameStr;
+ SmallString<256> NameStr;
getNameWithPrefix(NameStr, GV, TLOF->getMangler());
return TLOF->getContext().getOrCreateSymbol(NameStr);
}