[llvm] [AMDGPU] Localize resource info symbols (PR #185732)

Janek van Oirschot via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 11 05:28:19 PDT 2026


================
@@ -18,17 +18,23 @@
 #include "llvm/MC/MCAsmInfo.h"
 #include "llvm/MC/MCContext.h"
 #include "llvm/MC/MCSymbol.h"
+#include "llvm/Support/CommandLine.h"
 #include "llvm/Target/TargetMachine.h"
 
 #define DEBUG_TYPE "amdgpu-mc-resource-usage"
 
 using namespace llvm;
 
+static cl::opt<bool> LocalizeResourceSymbols(
----------------
JanekvO wrote:

My rationale was that we should avoid adding these symbols from getting into the symbol table while they're not going to be used yet (i.e., linking external calls) but still keep the possibility for somebody working on something like inter-module linking to re-enable them. (ideally, we move towards something similar to CGProfile to describe the callgraph with resource usage info as weights which should also decrease object size but for now I think having a switch would be fine).

Not sure what you've meant with 'It should be a property implied by the symbol'

https://github.com/llvm/llvm-project/pull/185732


More information about the llvm-commits mailing list