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

Juan Manuel Martinez CaamaƱo via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 2 01:11:44 PST 2026


================
@@ -173,6 +173,25 @@ void SPIRVSubtarget::initAvailableExtInstSets() {
   accountForAMDShaderTrinaryMinmax();
 }
 
+void SPIRVSubtarget::resolveEnvFromModule(const Module &M) {
+  if (Env != Unknown)
+    return;
+
+  bool HasShaderAttr = false;
+  for (const Function &F : M) {
+    if (F.getFnAttribute("hlsl.shader").isValid()) {
----------------
jmmartinez wrote:

Just for the context, shouldn't the caller be passing the appropriate target triple (maybe we do not have the right choices and we need to add one more)?

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


More information about the llvm-commits mailing list