[llvm] [SPIRV] Change how to detect OpenCL/Vulkan Env and update tests accordingly. (PR #129689)
Marcos Maronas via llvm-commits
llvm-commits at lists.llvm.org
Wed May 28 11:54:45 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") &&
----------------
maarquitos14 wrote:
To be honest, I don't see in the SPIR-V spec anything about environments being OpenCL/Vulkan. Anyway, I think what we are detecting here is capabilities because most uses of `isKernelEnv()/isShaderEnv()` are used to check if a particular feature is allowed --e.g. `Constant` decoration is only allowed if `Kernel` capability is enabled. Fundamentally, we want to know if we're dealing with graphical shaders or compute kernels.
https://github.com/llvm/llvm-project/pull/129689
More information about the llvm-commits
mailing list