[clang] [llvm] Make OpenCL an OSType rather than an EnvironmentType. (PR #170297)

Marcos Maronas via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 9 05:57:33 PST 2026


maarquitos14 wrote:

> I find the opencl naming a bit odd, but do not have something better to suggest.
> 
> I find it odd in the sense that opencl is not really an OS.

I agree, OpenCL is not an OS, but neither is Vulkan, as far as I know. I remember @Keenuts explaining why they did go for making Vulkan an `OSType`, but can't find the reference now. I think the point was that they needed the environment type for the shading stages (e.g. `spirv-unknown-vulkan-pixel`, `spirv-unknown-vulkan-vertex`). Please, @Keenuts, correct me if I'm wrong. This PR just aligns `OpenCL` with `Vulkan`.

> I'm also wondering how this could eventually compose with other targets. For example, if I'm compiling for amd, we could use amdgcn-amd-opencl instead of --amdhsa? and would that enable some simplification somewhere? Are other targets communicating some OpenCL specific information in the IR through other means, like metadata, attributes... that we could replace?

You could use `amdgcn-amd-opencl`, but I don't think it would replace `--amdhsa` at the moment. I don't really know, but that wasn't the intent of this PR, and I guess it would require some more work elsewhere. Like I said before, the main driver for this PR was to align `OpenCL` with `Vulkan`, and facilitate how `SPIRVSubtarget` chooses the environment.

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


More information about the llvm-commits mailing list