[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
Mon May 12 03:49:13 PDT 2025


================
@@ -36,6 +36,10 @@ class StringRef;
 class SPIRVTargetMachine;
 
 class SPIRVSubtarget : public SPIRVGenSubtargetInfo {
+public:
+  // Enum for the SPIR-V environment: OpenCL, Vulkan or Unkwnown.
----------------
maarquitos14 wrote:

`Unknown` is for the scenario where the triple is not explicit, e.g. `spirv-unknown-unknown`. Ideally, we will be able to infer the actual environment by analyzing the module, so we start with `Unknown` and we later set the environment when we find something in the module that unequivocally let us set an environment. It does *not* mean invalid. 

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


More information about the llvm-commits mailing list