[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:02 PST 2026


================
@@ -221,41 +221,17 @@ static SPIRVType *getArgSPIRVType(const Function &F, unsigned ArgIdx,
 
 static SPIRV::ExecutionModel::ExecutionModel
 getExecutionModel(const SPIRVSubtarget &STI, const Function &F) {
+  assert(STI.getEnv() != SPIRVSubtarget::Unknown &&
+         "Environment must be resolved before lowering entry points. ");
----------------
s-perron wrote:

```suggestion
         "Environment must be resolved before lowering entry points.");
```

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


More information about the llvm-commits mailing list