[llvm] [SPIRV] Change how to detect OpenCL/Vulkan Env and update tests accordingly. (PR #129689)

Nathan Gauër via llvm-commits llvm-commits at lists.llvm.org
Wed May 28 06:58:55 PDT 2025


================
@@ -767,10 +767,10 @@ Register SPIRVGlobalRegistry::buildGlobalVariable(
   // TODO: maybe move to GenerateDecorations pass.
   const SPIRVSubtarget &ST =
       cast<SPIRVSubtarget>(MIRBuilder.getMF().getSubtarget());
-  if (IsConst && ST.isOpenCLEnv())
+  if (IsConst && !ST.isShaderEnv())
----------------
Keenuts wrote:

If all that breaks/reaches this unknwon case is OpenCL (which keeps the legacy triple), I'm fine with this.

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


More information about the llvm-commits mailing list