[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
Tue May 27 05:59:12 PDT 2025
================
@@ -78,14 +83,22 @@ class SPIRVSubtarget : public SPIRVGenSubtargetInfo {
unsigned getPointerSize() const { return PointerSize; }
unsigned getBound() const { return GR->getBound(); }
bool canDirectlyComparePointers() const;
- // TODO: this environment is not implemented in Triple, we need to decide
- // how to standardize its support. For now, let's assume SPIR-V with physical
- // addressing is OpenCL, and Logical addressing is Vulkan.
- bool isOpenCLEnv() const {
+ void setEnv(SPIRVEnvType E) {
+ assert(E != Unknown && "Unknown environment is not allowed");
----------------
Keenuts wrote:
I'd also be in favor or an error, like `report_fatal_error` if the env is used when set/used with Unknown: most conditons we have are `if isKernel()/isShader() {} else` or something similar. Meaning the behavior you'd get by having Env set to unknown would inconsistent.
https://github.com/llvm/llvm-project/pull/129689
More information about the llvm-commits
mailing list