[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:34 PDT 2024
================
@@ -276,14 +304,22 @@ CallInst *DXILOpBuilder::createDXILOpCall(dxil::OpCode OpCode, Type *ReturnTy,
return B.CreateCall(DXILFn, Args);
}
-Type *DXILOpBuilder::getOverloadTy(dxil::OpCode OpCode, FunctionType *FT) {
+Type *DXILOpBuilder::getOverloadTy(dxil::OpCode OpCode, uint32_t SMVer,
+ FunctionType *FT) {
const OpCodeProperty *Prop = getOpCodeProperty(OpCode);
// If DXIL Op has no overload parameter, just return the
// precise return type specified.
if (Prop->OverloadParamIndex < 0) {
auto &Ctx = FT->getContext();
- switch (Prop->OverloadTys) {
+ uint16_t ValidTyMask = getValidOverloadMask(Prop, SMVer);
+ if (ValidTyMask == 0) {
+ report_fatal_error(StringRef(std::to_string(SMVer).append(
+ ": Unhandled Shader Model Version")),
+ /*gen_crash_diag*/ false);
+ }
+
+ switch (ValidTyMask) {
----------------
bogner wrote:
Is this right? You have something that's called a mask but you're checking if it exactly matches specific bits?
https://github.com/llvm/llvm-project/pull/87803
More information about the llvm-commits
mailing list