[llvm] [SPIRV] Emit intrinsics for globals only in function that references them (PR #178143)
Marcos Maronas via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 28 03:12:38 PST 2026
Juan Manuel Martinez =?utf-8?q?Caamaño?=,
Juan Manuel Martinez =?utf-8?q?Caamaño?Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/178143 at github.com>
================
@@ -2117,13 +2194,35 @@ Instruction *SPIRVEmitIntrinsics::visitUnreachableInst(UnreachableInst &I) {
return &I;
}
-void SPIRVEmitIntrinsics::processGlobalValue(GlobalVariable &GV,
- IRBuilder<> &B) {
+static bool
+shouldEmitIntrinsicsForGlobalValue(const GlobalVariableReferences &GlobalRefs,
+ GlobalVariable &GV, Function *F) {
----------------
maarquitos14 wrote:
```suggestion
const GlobalVariable &GV, Function *F) {
```
I think it should be okay to make GV const.
https://github.com/llvm/llvm-project/pull/178143
More information about the llvm-commits
mailing list