[llvm] [DXIL] Model DXIL Class and Shader Model association of DXIL Ops in DXIL.td (PR #87803)

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 9 17:10:33 PDT 2024


================
@@ -72,10 +73,26 @@ static SmallVector<Value *> argVectorFlatten(CallInst *Orig,
   return NewOperands;
 }
 
+static uint32_t getModuleShaderModelVersion(Module &M) {
+  std::string TTStr = M.getTargetTriple();
+  std::string Error;
+  auto Target = TargetRegistry::lookupTarget(TTStr, Error);
+  if (!Target) {
+    if (TTStr.empty()) {
+      report_fatal_error(StringRef(Error), /*gen_crash_diag*/ false);
+    }
+  }
----------------
bogner wrote:

This feels kind of unfortunate. We *are* in the DirectX backend so I suppose not having a DirectX triple is absurd outside of testing, but it still makes me sad to crash on it. Not sure we can do anything about it though.

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


More information about the llvm-commits mailing list