[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:54:25 PDT 2025


================
@@ -2058,7 +2058,7 @@ bool SPIRVInstructionSelector::selectDot4AddPackedExpansion(
   auto ExtractOp =
       Signed ? SPIRV::OpBitFieldSExtract : SPIRV::OpBitFieldUExtract;
 
-  bool ZeroAsNull = STI.isOpenCLEnv();
+  bool ZeroAsNull = !STI.isLogicalSPIRV();
----------------
Keenuts wrote:

I think this should be ~more correct to use this for ZeroAsNull, and all the other `getOrCreateConstInt`, since we do this to match DXC's behavior on 0 constant lowring, and also to respect the non-semantic shader debug extension.

```suggestion
  bool ZeroAsNull = !STI.isShaderEnv();
```

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


More information about the llvm-commits mailing list