[llvm] [SPIR-V] Fix environment resolution causing legalization crash (PR #179052)

Steven Perron via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 3 06:56:01 PST 2026


================
@@ -173,6 +173,25 @@ void SPIRVSubtarget::initAvailableExtInstSets() {
   accountForAMDShaderTrinaryMinmax();
 }
 
+void SPIRVSubtarget::resolveEnvFromModule(const Module &M) {
+  if (Env != Unknown)
+    return;
----------------
s-perron wrote:

Do we care about the case where the same instance of the backend is used to compile multiple modules that may have different ENVs? I think it is safe to fail in that case because that is generally not supported by an LLVM module anyway. I just want to be sure we make an explicit decision.

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


More information about the llvm-commits mailing list