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

Alexey Bader via llvm-commits llvm-commits at lists.llvm.org
Thu May 29 08:19:03 PDT 2025


================
@@ -532,7 +532,7 @@ void SPIRVAsmPrinter::outputExecutionMode(const Module &M) {
       Inst.addOperand(MCOperand::createImm(TypeCode));
       outputMCInst(Inst);
     }
-    if (ST->isOpenCLEnv() && !M.getNamedMetadata("spirv.ExecutionMode") &&
+    if (ST->isKernelEnv() && !M.getNamedMetadata("spirv.ExecutionMode") &&
----------------
bader wrote:

I prefer using terminology from the spec to avoid ambiguity.
For instance, Vulkan uses "compute shader" term for shaders doing GPGPU computations (i.e. what we call just "Shader" in clang project) - https://vulkan-tutorial.com/Compute_Shader.
Is it okay to use `isKernel`/`isShader`?

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


More information about the llvm-commits mailing list