[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
Fri May 2 02:22:17 PDT 2025


================
@@ -267,14 +267,42 @@ static SPIRVType *getArgSPIRVType(const Function &F, unsigned ArgIdx,
 
 static SPIRV::ExecutionModel::ExecutionModel
 getExecutionModel(const SPIRVSubtarget &STI, const Function &F) {
+  // FIXME: At the moment, there's a possibility that both `isOpenCLEnv()` and
+  // `isVulkanEnv()` return true. This is because the Triple is not always
+  // precise enough. For now, we'll rely instead on `isLogicalSPIRV()`, but this
+  // should be changed when `isOpenCLEnv()` and `isVulkanEnv()` cannot be true
+  // at the same time.
----------------
Keenuts wrote:

You mean both return false if the env is `Unknown` no?

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


More information about the llvm-commits mailing list