diff --git a/docs/DXIL.rst b/docs/DXIL.rst index 7d58ffee6a..ff8e4ec3d4 100644 --- a/docs/DXIL.rst +++ b/docs/DXIL.rst @@ -3209,6 +3209,7 @@ INSTR.ILLEGALDXILOPCODE DXILOpCode must be valid o INSTR.ILLEGALDXILOPFUNCTION '%0' is not a DXILOpFuncition for DXILOpcode '%1'. INSTR.IMMBIASFORSAMPLEB bias amount for sample_b must be in the range [%0,%1], but %2 was specified as an immediate. INSTR.INBOUNDSACCESS Access to out-of-bounds memory is disallowed. +INSTR.LINALGILLEGALKDIM Matrix K Dimension out of bounds. K=%0 must be >= %1 and <= %2. INSTR.MAYREORDERTHREADUNDEFCOHERENCEHINTPARAM Use of undef coherence hint or num coherence hint bits in MaybeReorderThread. INSTR.MINPRECISIONNOTPRECISE Instructions marked precise may not refer to minprecision values. INSTR.MINPRECISONBITCAST Bitcast on minprecison types is not allowed. diff --git a/include/dxc/DXIL/DxilConstants.h b/include/dxc/DXIL/DxilConstants.h index 24036e97f4..a4f63f5779 100644 --- a/include/dxc/DXIL/DxilConstants.h +++ b/include/dxc/DXIL/DxilConstants.h @@ -155,6 +155,9 @@ const unsigned kMinWaveSize = 4; const unsigned kMaxWaveSize = 128; const unsigned kDefaultMaxVectorLength = 4; const unsigned kSM69MaxVectorLength = 1024; +const unsigned kLinAlgThreadGroupMatrixMaxK = 1024; +const unsigned kLinAlgWaveThreadMatrixMaxK = 128; +const unsigned kLinAlgMatrixMinK = 4; const float kMaxMipLodBias = 15.99f; const float kMinMipLodBias = -16.0f; diff --git a/lib/DxilValidation/DxilValidation.cpp b/lib/DxilValidation/DxilValidation.cpp index 9625359c2e..01da55f08f 100644 --- a/lib/DxilValidation/DxilValidation.cpp +++ b/lib/DxilValidation/DxilValidation.cpp @@ -974,6 +974,56 @@ static void ValidateImmOperandForMathDxilOp(CallInst *CI, DXIL::OpCode Opcode, } } +static void ValidateLinAlgOpParameters(CallInst *CI, + ValidationContext &ValCtx) { + for (uint32_t Idx = 0; Idx < CI->getNumArgOperands(); ++Idx) { + Value *Arg = CI->getArgOperand(Idx); + Type *Ty = Arg->getType(); + + // No parameters may be undef + if (isa(Arg)) + ValCtx.EmitInstrError(CI, ValidationRule::InstrNoReadingUninitialized); + + // If we have a LinAlg Matrix, validate that we have correct metadata. + if (!dxilutil::IsHLSLLinAlgMatrixType(Ty)) + continue; + if (ValCtx.LinAlgTargetTypeMap.find(Ty) == + ValCtx.LinAlgTargetTypeMap.end()) { + ValCtx.EmitInstrError(CI, ValidationRule::MetaWellFormed); + continue; + } + } +} + +static void ValidateLinAlgOpReturnMatrix(CallInst *CI, + ValidationContext &ValCtx) { + Type *Ty = CI->getType(); + assert(dxilutil::IsHLSLLinAlgMatrixType(Ty) && "CI must return a matrix"); + + // Metadata is malformed if we don't have metadata + auto it = ValCtx.LinAlgTargetTypeMap.find(Ty); + if (it == ValCtx.LinAlgTargetTypeMap.end()) { + ValCtx.EmitInstrError(CI, ValidationRule::MetaWellFormed); + return; + } + + LinAlgTargetType LATT = it->second; + + // Validate the K dim is in bounds. Which dim is K depends on use. + // This validation isn't applied to an accumulator matrix + if (LATT.Use != DXIL::MatrixUse::Accumulator) { + unsigned MinK = DXIL::kLinAlgMatrixMinK; + unsigned K = (LATT.Use == DXIL::MatrixUse::A) ? LATT.N : LATT.M; + unsigned MaxK = (LATT.Scope == DXIL::MatrixScope::ThreadGroup) + ? DXIL::kLinAlgThreadGroupMatrixMaxK + : DXIL::kLinAlgWaveThreadMatrixMaxK; + if (K < MinK || K > MaxK) + ValCtx.EmitInstrFormatError( + CI, ValidationRule::InstrLinAlgIllegalKDim, + {std::to_string(K), std::to_string(MinK), std::to_string(MaxK)}); + } +} + // Validate the type-defined mask compared to the store value mask which // indicates which parts were defined returns true if caller should continue // validation @@ -1713,7 +1763,7 @@ static void ValidateDxilOperationCallInProfile(CallInst *CI, ShaderKind = DXIL::ShaderKind::Hull; } - // These shader models are treted like compute + // These shader models are treated like compute bool IsCSLike = ShaderKind == DXIL::ShaderKind::Compute || ShaderKind == DXIL::ShaderKind::Mesh || ShaderKind == DXIL::ShaderKind::Amplification || @@ -2177,6 +2227,36 @@ static void ValidateDxilOperationCallInProfile(CallInst *CI, ValCtx.EmitInstrFormatError(CI, ValidationRule::SmIsSpecialFloat, {}); break; } + + // LinAlg Operations + case DXIL::OpCode::LinAlgMatrixLength: + case DXIL::OpCode::LinAlgMatrixGetCoordinate: + case DXIL::OpCode::LinAlgMatrixGetElement: + case DXIL::OpCode::LinAlgMatrixStoreToDescriptor: + case DXIL::OpCode::LinAlgMatrixStoreToMemory: + case DXIL::OpCode::LinAlgMatVecMul: + case DXIL::OpCode::LinAlgMatVecMulAdd: + case DXIL::OpCode::LinAlgMatrixAccumulateToDescriptor: + case DXIL::OpCode::LinAlgMatrixAccumulateToMemory: + case DXIL::OpCode::LinAlgConvert: + case DXIL::OpCode::LinAlgVectorAccumulateToDescriptor: { + ValidateLinAlgOpParameters(CI, ValCtx); + break; + } + case DXIL::OpCode::LinAlgFillMatrix: + case DXIL::OpCode::LinAlgCopyConvertMatrix: + case DXIL::OpCode::LinAlgMatrixLoadFromDescriptor: + case DXIL::OpCode::LinAlgMatrixLoadFromMemory: + case DXIL::OpCode::LinAlgMatrixSetElement: + case DXIL::OpCode::LinAlgMatrixMultiply: + case DXIL::OpCode::LinAlgMatrixAccumulate: + case DXIL::OpCode::LinAlgMatrixMultiplyAccumulate: + case DXIL::OpCode::LinAlgMatrixOuterProduct: { + ValidateLinAlgOpReturnMatrix(CI, ValCtx); + ValidateLinAlgOpParameters(CI, ValCtx); + break; + } + default: // TODO: make sure every Opcode is checked. // Skip opcodes don't need special check. diff --git a/lib/DxilValidation/DxilValidationUtils.cpp b/lib/DxilValidation/DxilValidationUtils.cpp index 8caeb6f83a..ab683fdce2 100644 --- a/lib/DxilValidation/DxilValidationUtils.cpp +++ b/lib/DxilValidation/DxilValidationUtils.cpp @@ -11,6 +11,8 @@ #include "DxilValidationUtils.h" +#include + #include "dxc/DXIL/DxilEntryProps.h" #include "dxc/DXIL/DxilInstructions.h" #include "dxc/DXIL/DxilModule.h" @@ -39,6 +41,37 @@ EntryStatus::EntryStatus(DxilEntryProps &entryProps) entryProps.sig.PatchConstOrPrimSignature.GetElements().size(), 0); } +static void +TryAddLinAlgTargetType(MDTuple *MDT, + std::unordered_map &Map) { + if (!MDT || MDT->getNumOperands() != 6) + return; + + ConstantAsMetadata *ConstMD0 = + dyn_cast(MDT->getOperand(0).get()); + if (!ConstMD0) + return; + + Type *Ty = ConstMD0->getValue()->getType(); + uint64_t Ints[5]; + + for (size_t I = 0; I < 5; ++I) { + ConstantAsMetadata *ConstMDI = + dyn_cast(MDT->getOperand(I + 1).get()); + if (!ConstMDI) + return; + ConstantInt *CI = dyn_cast(ConstMDI->getValue()); + if (!CI) + return; + Ints[I] = CI->getLimitedValue(); + } + + Map.try_emplace( + Ty, LinAlgTargetType{static_cast(Ints[0]), Ints[1], + Ints[2], static_cast(Ints[3]), + static_cast(Ints[4])}); +} + ValidationContext::ValidationContext(Module &llvmModule, Module *DebugModule, DxilModule &dxilModule) : M(llvmModule), pDebugModule(DebugModule), DxilMod(dxilModule), @@ -89,6 +122,16 @@ ValidationContext::ValidationContext(Module &llvmModule, Module *DebugModule, Entry); } } + + // Capture the TargetTypes metadata in the validation context + // if it is present and valid. + NamedMDNode *NMD = M.getNamedMetadata("dx.targetTypes"); + if (NMD) { + for (llvm::MDNode *MDN : NMD->operands()) { + MDTuple *MDT = dyn_cast(MDN); + TryAddLinAlgTargetType(MDT, LinAlgTargetTypeMap); + } + } } void ValidationContext::PropagateResMap(Value *V, DxilResourceBase *Res) { diff --git a/lib/DxilValidation/DxilValidationUtils.h b/lib/DxilValidation/DxilValidationUtils.h index 693c3756e1..a16b7a66da 100644 --- a/lib/DxilValidation/DxilValidationUtils.h +++ b/lib/DxilValidation/DxilValidationUtils.h @@ -63,6 +63,14 @@ struct EntryStatus { EntryStatus(DxilEntryProps &entryProps); }; +struct LinAlgTargetType { + DXIL::ComponentType Type; + unsigned M; + unsigned N; + DXIL::MatrixUse Use; + DXIL::MatrixScope Scope; +}; + struct ValidationContext { bool Failed = false; Module &M; @@ -80,6 +88,7 @@ struct ValidationContext { std::unordered_map ResPropMap; std::unordered_map> PatchConstantFuncMap; std::unordered_map> entryStatusMap; + std::unordered_map LinAlgTargetTypeMap; bool isLibProfile; const unsigned kDxilControlFlowHintMDKind; const unsigned kDxilPreciseMDKind; diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/copyconvertmatrix/nominal.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/copyconvertmatrix/nominal.hlsl index 5b6d8d95e5..6780c0cc83 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/copyconvertmatrix/nominal.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/copyconvertmatrix/nominal.hlsl @@ -7,12 +7,15 @@ void main() { // CHECK-LABEL: define void @main() // CHECK: call %dx.types.LinAlgMatrixC4M5N4U1S2 @dx.op.linAlgCopyConvertMatrix.mC4M5N4U1S2.mC2M5N4U1S2 - // CHECK-SAME: (i32 -2147483635, %dx.types.LinAlgMatrixC2M5N4U1S2 {{.*}}, i1 false) + // CHECK-SAME: (i32 -2147483635, %dx.types.LinAlgMatrixC2M5N4U1S2 %{{.*}}, i1 false) // CHECK-SAME: ; LinAlgCopyConvertMatrix(srcMatrix,transpose) // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC4M5N4U1S2*, %dx.types.LinAlgMatrixC2M5N4U1S2, i1)" - // CHECK2-SAME: (i32 401, %dx.types.LinAlgMatrixC4M5N4U1S2* {{.*}}, %dx.types.LinAlgMatrixC2M5N4U1S2 {{.*}}, i1 false) + // CHECK2-SAME: (i32 401, %dx.types.LinAlgMatrixC4M5N4U1S2* %{{.*}}, %dx.types.LinAlgMatrixC2M5N4U1S2 {{.*}}, i1 false) __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(2, 5, 4, 1, 2)]] mat1; __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat2; + + __builtin_LinAlg_FillMatrix(mat1, 1); + __builtin_LinAlg_CopyConvertMatrix(mat2, mat1, false); } diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulate/nominal.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulate/nominal.hlsl index 6a9490e624..485f90617b 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulate/nominal.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulate/nominal.hlsl @@ -6,15 +6,18 @@ void main() { // CHECK-LABEL: define void @main() - __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(5, 3, 4, 0, 0)]] mat1; - __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(1, 1, 1, 0, 0)]] mat2; - __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(2, 2, 2, 2, 2)]] mat3; - - // CHECK: call %dx.types.LinAlgMatrixC2M2N2U2S2 @dx.op.linAlgMatrixAccumulate.mC2M2N2U2S2.mC1M1N1U0S0.mC5M3N4U0S - // CHECK-SAME: (i32 -2147483624, %dx.types.LinAlgMatrixC1M1N1U0S0 {{.*}}, %dx.types.LinAlgMatrixC5M3N4U0S0 {{.*}}) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) + __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(5, 4, 4, 0, 0)]] mat1; + __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(5, 4, 4, 0, 0)]] mat2; + __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(5, 4, 4, 0, 0)]] mat3; - // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC2M2N2U2S2*, %dx.types.LinAlgMatrixC1M1N1U0S0, - // CHECK2-SAME: %dx.types.LinAlgMatrixC5M3N4U0S0)"(i32 411, %dx.types.LinAlgMatrixC2M2N2U2S2* %mat3, - // CHECK2-SAME: %dx.types.LinAlgMatrixC1M1N1U0S0 %{{[0-9]+}}, %dx.types.LinAlgMatrixC5M3N4U0S0 %{{[0-9]+}}) + __builtin_LinAlg_FillMatrix(mat1, 1); + __builtin_LinAlg_FillMatrix(mat2, 2); + + // CHECK: call %dx.types.LinAlgMatrixC5M4N4U0S0 @dx.op.linAlgMatrixAccumulate.mC5M4N4U0S0.mC5M4N4U0S0.mC5M4N4U0S0 + // CHECK-SAME: (i32 -2147483624, %dx.types.LinAlgMatrixC5M4N4U0S0 %{{.*}}, %dx.types.LinAlgMatrixC5M4N4U0S0 %{{.*}}) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) + + // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC5M4N4U0S0*, %dx.types.LinAlgMatrixC5M4N4U0S0, + // CHECK2-SAME: %dx.types.LinAlgMatrixC5M4N4U0S0)"(i32 411, %dx.types.LinAlgMatrixC5M4N4U0S0* %mat3, + // CHECK2-SAME: %dx.types.LinAlgMatrixC5M4N4U0S0 %{{[0-9]+}}, %dx.types.LinAlgMatrixC5M4N4U0S0 %{{[0-9]+}}) __builtin_LinAlg_MatrixAccumulate(mat3, mat2, mat1); } diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulatetodescriptor/nominal.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulatetodescriptor/nominal.hlsl index 3c9c4ab3ef..591eebf5e7 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulatetodescriptor/nominal.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulatetodescriptor/nominal.hlsl @@ -9,11 +9,12 @@ void main() { // CHECK-LABEL: define void @main() // CHECK: call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U1S2(i32 -2147483621, - // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, %dx.types.Handle %{{.*}}, i32 5, i32 5, i32 5, i32 4) + // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 %{{.*}}, %dx.types.Handle %{{.*}}, i32 5, i32 5, i32 5, i32 4) // CHECK-SAME: ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC4M5N4U1S2, %dx.types.Handle, i32, i32, i32, i32)" - // CHECK2-SAME: (i32 415, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, %dx.types.Handle {{.*}}, i32 5, i32 5, i32 5, i32 4) + // CHECK2-SAME: (i32 415, %dx.types.LinAlgMatrixC4M5N4U1S2 %{{.*}}, %dx.types.Handle {{.*}}, i32 5, i32 5, i32 5, i32 4) __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat; + __builtin_LinAlg_FillMatrix(mat, 1); __builtin_LinAlg_MatrixAccumulateToDescriptor(mat, outbuf, 5, 5, 5, 4); } diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulatetomemory/nominal.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulatetomemory/nominal.hlsl index bf6ebb6e77..3adfac877c 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulatetomemory/nominal.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulatetomemory/nominal.hlsl @@ -10,14 +10,15 @@ void main() { // CHECK-LABEL: define void @main() // CHECK: call void @dx.op.linAlgMatrixAccumulateToMemory.mC4M5N4U1S2.f32(i32 -2147483620, - // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, float addrspace(3)* getelementptr inbounds ([64 x float], + // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 %{{.*}}, float addrspace(3)* getelementptr inbounds ([64 x float], // CHECK-SAME: [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 1, i32 2, i32 3) // CHECK-SAME: ; LinAlgMatrixAccumulateToMemory(matrix,memory,offset,stride,layout) // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC4M5N4U1S2, // CHECK2-SAME: [64 x float] addrspace(3)*, i32, i32, i32)"(i32 416, - // CHECK2-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", + // CHECK2-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 %{{.*}}, [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", // CHECK2-SAME: i32 1, i32 2, i32 3) __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat; + __builtin_LinAlg_FillMatrix(mat, 1); __builtin_LinAlg_MatrixAccumulateToMemory(mat, SharedArr, 1, 2, 3); } diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixgetcoordinate/nominal.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixgetcoordinate/nominal.hlsl index 3c44ae5370..9732790d20 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixgetcoordinate/nominal.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixgetcoordinate/nominal.hlsl @@ -7,11 +7,12 @@ void main() { // CHECK-LABEL: define void @main() // CHECK: call <2 x i32> @dx.op.linAlgMatrixGetCoordinate.mC4M5N4U1S2(i32 -2147483631, - // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i32 1) + // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 %{{.*}}, i32 1) // CHECK-SAME: ; LinAlgMatrixGetCoordinate(matrix,threadLocalIndex) // CHECK2: call <2 x i32> @"dx.hl.op..<2 x i32> (i32, %dx.types.LinAlgMatrixC4M5N4U1S2, i32)" - // CHECK2-SAME: (i32 403, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i32 1) + // CHECK2-SAME: (i32 403, %dx.types.LinAlgMatrixC4M5N4U1S2 %{{.*}}, i32 1) __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat; + __builtin_LinAlg_FillMatrix(mat, 1); uint2 coord = __builtin_LinAlg_MatrixGetCoordinate(mat, 1); } diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixgetelement/nominal.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixgetelement/nominal.hlsl index ed296e20b4..0f16ff9d90 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixgetelement/nominal.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixgetelement/nominal.hlsl @@ -9,39 +9,40 @@ void main() { __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat; // CHECK: call i32 @dx.op.linAlgMatrixGetElement.i32.mC4M5N4U1S2(i32 -2147483630, - // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i32 0) + // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 %{{.*}}, i32 0) // CHECK-SAME: ; LinAlgMatrixGetElement(matrix,threadLocalIndex) // CHECK2: call void @"dx.hl.op..void (i32, i32*, %dx.types.LinAlgMatrixC4M5N4U1S2, i32)" - // CHECK2-SAME: (i32 404, i32* %elem1, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i32 0) + // CHECK2-SAME: (i32 404, i32* %elem1, %dx.types.LinAlgMatrixC4M5N4U1S2 %{{.*}}, i32 0) uint elem1; + __builtin_LinAlg_FillMatrix(mat, 1); __builtin_LinAlg_MatrixGetElement(elem1, mat, 0); // CHECK: call float @dx.op.linAlgMatrixGetElement.f32.mC4M5N4U1S2(i32 -2147483630, - // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i32 1) + // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 %{{.*}}, i32 1) // CHECK-SAME: ; LinAlgMatrixGetElement(matrix,threadLocalIndex) // CHECK2: call void @"dx.hl.op..void (i32, float*, %dx.types.LinAlgMatrixC4M5N4U1S2, i32)" - // CHECK2-SAME: (i32 404, float* %elem2, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i32 1) + // CHECK2-SAME: (i32 404, float* %elem2, %dx.types.LinAlgMatrixC4M5N4U1S2 %{{.*}}, i32 1) float elem2; __builtin_LinAlg_MatrixGetElement(elem2, mat, 1); // CHECK: call double @dx.op.linAlgMatrixGetElement.f64.mC4M5N4U1S2(i32 -2147483630, - // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i32 1) + // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 %{{.*}}, i32 1) // CHECK-SAME: ; LinAlgMatrixGetElement(matrix,threadLocalIndex) // CHECK2: call void @"dx.hl.op..void (i32, double*, %dx.types.LinAlgMatrixC4M5N4U1S2, i32)" - // CHECK2-SAME: (i32 404, double* %elem3, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i32 1) + // CHECK2-SAME: (i32 404, double* %elem3, %dx.types.LinAlgMatrixC4M5N4U1S2 %{{.*}}, i32 1) double elem3; __builtin_LinAlg_MatrixGetElement(elem3, mat, 1); // CHECK: call i64 @dx.op.linAlgMatrixGetElement.i64.mC4M5N4U1S2(i32 -2147483630, - // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i32 1) + // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 %{{.*}}, i32 1) // CHECK-SAME: ; LinAlgMatrixGetElement(matrix,threadLocalIndex) // CHECK2: call void @"dx.hl.op..void (i32, i64*, %dx.types.LinAlgMatrixC4M5N4U1S2, i32)" - // CHECK2-SAME: (i32 404, i64* %elem4, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i32 1) + // CHECK2-SAME: (i32 404, i64* %elem4, %dx.types.LinAlgMatrixC4M5N4U1S2 %{{.*}}, i32 1) int64_t elem4; __builtin_LinAlg_MatrixGetElement(elem4, mat, 1); } diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixlength/nominal.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixlength/nominal.hlsl index 44c2ce6136..a21539d412 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixlength/nominal.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixlength/nominal.hlsl @@ -7,10 +7,11 @@ void main() { // CHECK-LABEL: define void @main() // CHECK: call i32 @dx.op.linAlgMatrixLength.mC4M5N4U1S2(i32 -2147483632, - // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}) ; LinAlgMatrixLength(matrix) + // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 %{{.*}}) ; LinAlgMatrixLength(matrix) // CHECK2: call i32 @"dx.hl.op..i32 (i32, %dx.types.LinAlgMatrixC4M5N4U1S2)" - // CHECK2-SAME: (i32 405, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}) + // CHECK2-SAME: (i32 405, %dx.types.LinAlgMatrixC4M5N4U1S2 %{{.*}}) __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat; + __builtin_LinAlg_FillMatrix(mat, 1); uint len = __builtin_LinAlg_MatrixLength(mat); } diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixloadfromdescriptor/nominal.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixloadfromdescriptor/nominal.hlsl index 727ec19ca8..ed14e3d324 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixloadfromdescriptor/nominal.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixloadfromdescriptor/nominal.hlsl @@ -8,12 +8,12 @@ ByteAddressBuffer inbuf; void main() { // CHECK-LABEL: define void @main() - // CHECK: %{{.*}} = call %dx.types.LinAlgMatrixC1M1N1U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC1M1N1U0S0 + // CHECK: %{{.*}} = call %dx.types.LinAlgMatrixC1M4N4U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC1M4N4U0S0 // CHECK-SAME: (i32 -2147483634, %dx.types.Handle %{{.*}}, i32 0, i32 0, i32 0, i32 4) // CHECK-SAME: ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) - // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC1M1N1U0S0*, %dx.types.Handle, i32, i32, i32, i32) - // CHECK2-SAME: "(i32 406, %dx.types.LinAlgMatrixC1M1N1U0S0* %mat, %dx.types.Handle {{.*}}, i32 0, i32 0, i32 0, i32 4) - __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(1, 1, 1, 0, 0)]] mat; + // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC1M4N4U0S0*, %dx.types.Handle, i32, i32, i32, i32) + // CHECK2-SAME: "(i32 406, %dx.types.LinAlgMatrixC1M4N4U0S0* %mat, %dx.types.Handle {{.*}}, i32 0, i32 0, i32 0, i32 4) + __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(1, 4, 4, 0, 0)]] mat; __builtin_LinAlg_MatrixLoadFromDescriptor(mat, inbuf, 0, 0, 0, 4); } diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixmatrixmultiply/nominal.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixmatrixmultiply/nominal.hlsl index 73b901a17a..817a4acefe 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixmatrixmultiply/nominal.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixmatrixmultiply/nominal.hlsl @@ -7,12 +7,13 @@ void main() { // CHECK-LABEL: define void @main() // CHECK: call %dx.types.LinAlgMatrixC4M5N4U1S2 @dx.op.linAlgMatrixMultiply.mC4M5N4U1S2.mC4M5N4U1S2.mC4M5N4U1S2(i32 -2147483625, - // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}) ; LinAlgMatrixMultiply(matrixA,matrixB) + // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 %{{.*}}, %dx.types.LinAlgMatrixC4M5N4U1S2 %{{.*}}) ; LinAlgMatrixMultiply(matrixA,matrixB) // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC4M5N4U1S2*, %dx.types.LinAlgMatrixC4M5N4U1S2, // CHECK2-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2)"(i32 412, %dx.types.LinAlgMatrixC4M5N4U1S2* %mat2, // CHECK2-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 %{{[0-9]+}}, %dx.types.LinAlgMatrixC4M5N4U1S2 %{{[0-9]+}}) __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat1; + __builtin_LinAlg_FillMatrix(mat1, 1); __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat2; __builtin_LinAlg_MatrixMatrixMultiply(mat2, mat1, mat1); } diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixmatrixmultiplyaccumulate/nominal.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixmatrixmultiplyaccumulate/nominal.hlsl index 86c2dd4db7..458f08c6a4 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixmatrixmultiplyaccumulate/nominal.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixmatrixmultiplyaccumulate/nominal.hlsl @@ -6,17 +6,26 @@ void main() { // CHECK-LABEL: define void @main() + // The FillMatrix calls are similar enough that they start matching + // the CHECK-SAME lines so we consume them first. + // CHECK: ; LinAlgFillMatrix(value) + // CHECK: ; LinAlgFillMatrix(value) + // CHECK: ; LinAlgFillMatrix(value) + // CHECK: call %dx.types.LinAlgMatrixC4M5N3U1S2 // CHECK-SAME: @dx.op.linAlgMatrixMultiplyAccumulate.mC4M5N3U1S2.mC4M5N4U1S2.mC4M4N3U1S2.mC4M5N3U1S2 - // CHECK-SAME: (i32 -2147483637, %dx.types.LinAlgMatrixC4M5N4U1S2 undef, %dx.types.LinAlgMatrixC4M4N3U1S2 undef, - // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N3U1S2 undef) ; LinAlgMatrixMultiplyAccumulate(matrixA,matrixB,matrixC) - + // CHECK-SAME: (i32 -2147483637, %dx.types.LinAlgMatrixC4M5N4U1S2 %{{[0-9]+}}, %dx.types.LinAlgMatrixC4M4N3U1S2 %{{[0-9]+}}, + // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N3U1S2 %{{[0-9]+}}) ; LinAlgMatrixMultiplyAccumulate(matrixA,matrixB,matrixC) + // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC4M5N3U1S2*, %dx.types.LinAlgMatrixC4M5N4U1S2, // CHECK2-SAME: %dx.types.LinAlgMatrixC4M4N3U1S2, %dx.types.LinAlgMatrixC4M5N3U1S2)"(i32 413, - // CHECK2-SAME: %dx.types.LinAlgMatrixC4M5N3U1S2* {{.*}}, %dx.types.LinAlgMatrixC4M5N4U1S2 %{{[0-9]+}}, + // CHECK2-SAME: %dx.types.LinAlgMatrixC4M5N3U1S2* %{{.*}}, %dx.types.LinAlgMatrixC4M5N4U1S2 %{{[0-9]+}}, // CHECK2-SAME: %dx.types.LinAlgMatrixC4M4N3U1S2 %{{[0-9]+}}, %dx.types.LinAlgMatrixC4M5N3U1S2 %{{[0-9]+}}) __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat1; + __builtin_LinAlg_FillMatrix(mat1, 1); __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 4, 3, 1, 2)]] mat2; + __builtin_LinAlg_FillMatrix(mat2, 2); __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 3, 1, 2)]] mat3; + __builtin_LinAlg_FillMatrix(mat3, 3); __builtin_LinAlg_MatrixMatrixMultiplyAccumulate(mat3, mat1, mat2, mat3); } diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixsetelement/nominal.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixsetelement/nominal.hlsl index c1ee5f168e..952096af29 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixsetelement/nominal.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixsetelement/nominal.hlsl @@ -10,13 +10,15 @@ void main() { // CHECK-LABEL: define void @main() // CHECK: call %dx.types.LinAlgMatrixC4M5N4U1S2 @dx.op.linAlgMatrixSetElement.mC4M5N4U1S2.mC4M5N4U1S2.i32 - // CHECK-SAME: (i32 -2147483629, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i32 1, i32 5) + // CHECK-SAME: (i32 -2147483629, %dx.types.LinAlgMatrixC4M5N4U1S2 %{{.*}}, i32 1, i32 5) // CHECK-SAME: ; LinAlgMatrixSetElement(matrix,threadLocalIndex,value) // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC4M5N4U1S2*, %dx.types.LinAlgMatrixC4M5N4U1S2, i32, i32) - // CHECK2-SAME: "(i32 408, %dx.types.LinAlgMatrixC4M5N4U1S2* {{.*}}, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i32 1, i32 5) + // CHECK2-SAME: "(i32 408, %dx.types.LinAlgMatrixC4M5N4U1S2* %{{.*}}, %dx.types.LinAlgMatrixC4M5N4U1S2 %{{.*}}, i32 1, i32 5) __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat1; + __builtin_LinAlg_FillMatrix(mat1, 1); + __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat2; __builtin_LinAlg_MatrixSetElement(mat2, mat1, 1, 5); } diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixstoretodescriptor/nominal.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixstoretodescriptor/nominal.hlsl index 352a34ac1a..dcbee120f5 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixstoretodescriptor/nominal.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixstoretodescriptor/nominal.hlsl @@ -9,11 +9,12 @@ void main() { // CHECK-LABEL: define void @main() // CHECK: call void @dx.op.linAlgMatrixStoreToDescriptor.mC4M5N4U1S2(i32 -2147483628, - // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, %dx.types.Handle %{{.*}}, i32 1, i32 1, i32 0, i32 4) + // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 %{{.*}}, %dx.types.Handle %{{.*}}, i32 1, i32 1, i32 0, i32 4) // CHECK-SAME: ; LinAlgMatrixStoreToDescriptor(matrix,handle,offset,stride,layout,align) // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC4M5N4U1S2, %dx.types.Handle, i32, i32, i32, i32) - // CHECK2-SAME: "(i32 409, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, %dx.types.Handle {{.*}}, i32 1, i32 1, i32 0, i32 4) - __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat1; - __builtin_LinAlg_MatrixStoreToDescriptor(mat1, outbuf, 1, 1, 0, 4); + // CHECK2-SAME: "(i32 409, %dx.types.LinAlgMatrixC4M5N4U1S2 %{{.*}}, %dx.types.Handle {{.*}}, i32 1, i32 1, i32 0, i32 4) + __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat; + __builtin_LinAlg_FillMatrix(mat, 1); + __builtin_LinAlg_MatrixStoreToDescriptor(mat, outbuf, 1, 1, 0, 4); } diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixstoretomemory/nominal.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixstoretomemory/nominal.hlsl index 18e3c1cbc3..51b30ec0c2 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixstoretomemory/nominal.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixstoretomemory/nominal.hlsl @@ -10,7 +10,7 @@ void main() { // CHECK-LABEL: define void @main() // CHECK: call void @dx.op.linAlgMatrixStoreToMemory.mC4M5N4U1S2.f32(i32 -2147483627, - // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, float addrspace(3)* getelementptr + // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 %{{.*}}, float addrspace(3)* getelementptr // CHECK-SAME: inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", // CHECK-SAME: i32 0, i32 0), i32 1, i32 2, i32 3) ; LinAlgMatrixStoreToMemory(matrix,memory,offset,stride,layout) @@ -18,5 +18,6 @@ void main() { // CHECK2-SAME: (i32 410, %dx.types.LinAlgMatrixC4M5N4U1S2 %{{.*}}, [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", // CHECK2-SAME: i32 1, i32 2, i32 3) __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat; + __builtin_LinAlg_FillMatrix(mat, 1); __builtin_LinAlg_MatrixStoreToMemory(mat, SharedArr, 1, 2, 3); } diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixvectormultiply/nominal.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixvectormultiply/nominal.hlsl index 23c5b619b7..fc9fd3ee00 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixvectormultiply/nominal.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixvectormultiply/nominal.hlsl @@ -7,14 +7,15 @@ void main() { // CHECK-LABEL: define void @main() __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat; + __builtin_LinAlg_FillMatrix(mat, 1); float4 vec = {1,2,3,4}; float4 result; // CHECK: call <4 x float> @dx.op.linAlgMatVecMul.v4f32.mC4M5N4U1S2.v4f32(i32 -2147483623, - // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i1 true, <4 x float> , i32 1) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) // CHECK2: call void @"dx.hl.op..void (i32, <4 x float>*, %dx.types.LinAlgMatrixC4M5N4U1S2, i1, <4 x float>, i32) - // CHECK2-SAME: "(i32 418, <4 x float>* %result, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i1 true, <4 x float> {{.*}}, i32 1) + // CHECK2-SAME: "(i32 418, <4 x float>* %result, %dx.types.LinAlgMatrixC4M5N4U1S2 %{{.*}}, i1 true, <4 x float> %{{.*}}, i32 1) __builtin_LinAlg_MatrixVectorMultiply(result, mat, true, vec, 1); } diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixvectormultiplyadd/nominal.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixvectormultiplyadd/nominal.hlsl index edfa306148..b0d298bb49 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixvectormultiplyadd/nominal.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixvectormultiplyadd/nominal.hlsl @@ -6,12 +6,13 @@ void main() { // CHECK-LABEL: define void @main() __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(5, 3, 4, 0, 0)]] mat1; + __builtin_LinAlg_FillMatrix(mat1, 1); float4 vec = {1,2,3,4}; - float4 result; + float4 result = 0; // CHECK: call <4 x float> @dx.op.linAlgMatVecMulAdd.v4f32.mC5M3N4U0S0.v4f32.v4f32(i32 -2147483622, - // CHECK-SAME: %dx.types.LinAlgMatrixC5M3N4U0S0 {{.*}}, i1 true, <4 x float> , i32 1, <4 x float> {{.*}}, i32 0) + // CHECK-SAME: %dx.types.LinAlgMatrixC5M3N4U0S0 %{{.*}}, i1 true, <4 x float> , i32 1, <4 x float> zeroinitializer, i32 0) // CHECK-SAME: ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) // CHECK2: call void @"dx.hl.op..void (i32, <4 x float>*, %dx.types.LinAlgMatrixC5M3N4U0S0, i1, <4 x float>, @@ -21,12 +22,13 @@ void main() { __builtin_LinAlg_MatrixVectorMultiplyAdd(result, mat1, true, vec, 1, result, 0); __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(5, 3, 4, 0, 0)]] mat2; + __builtin_LinAlg_FillMatrix(mat2, 2); double4 vec2 = {1,2,3,4}; - double4 result2; + double4 result2 = 0; // CHECK: call <4 x double> @dx.op.linAlgMatVecMulAdd.v4f64.mC5M3N4U0S0.v4f64.v4f64(i32 -2147483622, - // CHECK-SAME: %dx.types.LinAlgMatrixC5M3N4U0S0 {{.*}}, i1 true, <4 x double> , i32 1, <4 x double> {{.*}}, i32 0) + // CHECK-SAME: %dx.types.LinAlgMatrixC5M3N4U0S0 %{{.*}}, i1 true, <4 x double> , i32 1, <4 x double> zeroinitializer, i32 0) // CHECK-SAME: ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) // CHECK2: call void @"dx.hl.op..void (i32, <4 x double>*, %dx.types.LinAlgMatrixC5M3N4U0S0, i1, <4 x double>, @@ -36,12 +38,13 @@ void main() { __builtin_LinAlg_MatrixVectorMultiplyAdd(result2, mat2, true, vec2, 1, result2, 0); __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(5, 3, 4, 0, 0)]] mat3; + __builtin_LinAlg_FillMatrix(mat3, 3); vector vec3 = {1,2,3,4}; - vector result3; + vector result3 = 0; // CHECK: call <4 x i64> @dx.op.linAlgMatVecMulAdd.v4i64.mC5M3N4U0S0.v4i64.v4i64(i32 -2147483622, - // CHECK-SAME: %dx.types.LinAlgMatrixC5M3N4U0S0 {{.*}}, i1 true, <4 x i64> , i32 1, <4 x i64> {{.*}}, i32 0) + // CHECK-SAME: %dx.types.LinAlgMatrixC5M3N4U0S0 %{{.*}}, i1 true, <4 x i64> , i32 1, <4 x i64> zeroinitializer, i32 0) // CHECK-SAME: ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) // CHECK2: call void @"dx.hl.op..void (i32, <4 x i64>*, %dx.types.LinAlgMatrixC5M3N4U0S0, i1, <4 x i64>, @@ -50,8 +53,13 @@ void main() { __builtin_LinAlg_MatrixVectorMultiplyAdd(result3, mat3, true, vec3, 1, result3, 0); + __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(17, 8, 8, 0, 0)]] mat4; + __builtin_LinAlg_FillMatrix(mat4, 4); + vector vec4 = 0; + vector result4 = 0; + // CHECK: call <8 x i32> @dx.op.linAlgMatVecMulAdd.v8i32.mC17M8N8U0S0.v8i32.v8i32(i32 -2147483622, - // CHECK-SAME: %dx.types.LinAlgMatrixC17M8N8U0S0 {{.*}}, i1 true, <8 x i32> zeroinitializer, + // CHECK-SAME: %dx.types.LinAlgMatrixC17M8N8U0S0 %{{.*}}, i1 true, <8 x i32> zeroinitializer, // CHECK-SAME: i32 1, <8 x i32> zeroinitializer, i32 0) // CHECK-SAME: ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) @@ -59,8 +67,5 @@ void main() { // CHECK2-SAME: i32, <8 x i32>, i32)"(i32 419, <8 x i32>* %result4, %dx.types.LinAlgMatrixC17M8N8U0S0 %{{[0-9]+}}, // CHECK2-SAME: i1 true, <8 x i32> %{{[0-9]+}}, i32 1, <8 x i32> %{{[0-9]+}}, i32 0) - __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(17, 8, 8, 0, 0)]] mat4; - vector vec4 = 0; - vector result4 = 0; __builtin_LinAlg_MatrixVectorMultiplyAdd(result4, mat4, true, vec4, 1, result4, 0); } diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/trim-target-types-metadata-compute.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/trim-target-types-metadata-compute.hlsl index d31fcb2942..347c5daa18 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/trim-target-types-metadata-compute.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/trim-target-types-metadata-compute.hlsl @@ -13,8 +13,10 @@ uint useMatrix1() { // mat1 = Matrix::Splat(5); __builtin_LinAlg_FillMatrix(mat1, 5); - // Matrix m; - __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(5, 3, 3, 0, 0)]] mat2; + // Matrix m; + __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(5, 8, 8, 0, 0)]] mat2; + // mat2 = Matrix::Splat(1); + __builtin_LinAlg_FillMatrix(mat2, 1); // return mat2.Length(); return __builtin_LinAlg_MatrixLength(mat2); } @@ -37,5 +39,5 @@ void main() { // CHECK: !dx.targetTypes = !{!{{[0-9]+}}, !{{[0-9]+}}} // CHECK: !{{[0-9]+}} = !{%dx.types.LinAlgMatrixC4M4N5U0S0 undef, i32 4, i32 4, i32 5, i32 0, i32 0} -// CHECK: !{{[0-9]+}} = !{%dx.types.LinAlgMatrixC5M3N3U0S0 undef, i32 5, i32 3, i32 3, i32 0, i32 0} +// CHECK: !{{[0-9]+}} = !{%dx.types.LinAlgMatrixC5M8N8U0S0 undef, i32 5, i32 8, i32 8, i32 0, i32 0} // CHECK-NOT: !{%dx.types.LinAlgMatrixC10M2N2U1S1 undef, i32 10, i32 2, i32 2, i32 1, i32 1} diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/trim-target-types-metadata-lib.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/trim-target-types-metadata-lib.hlsl index a6a9fa82c2..35aa78380c 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/trim-target-types-metadata-lib.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/trim-target-types-metadata-lib.hlsl @@ -31,7 +31,9 @@ uint useMatrix1() { uint useMatrix2() { // Matrix m; - __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(10, 2, 2, 1, 1)]] mat2; + __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(10, 4, 4, 1, 1)]] mat2; + // Matrix::Splat(1) + __builtin_LinAlg_FillMatrix(mat2, 1); // return mat2.Length(); return __builtin_LinAlg_MatrixLength(mat2); } @@ -74,7 +76,7 @@ void CSMain3() { // Target types in lib1 // LIB1: !dx.targetTypes = !{![[TT1:.*]], ![[TT2:.*]]} // LIB1: ![[TT1]] = !{%dx.types.LinAlgMatrixC4M4N5U0S0 undef, i32 4, i32 4, i32 5, i32 0, i32 0} -// LIB1: ![[TT2]] = !{%dx.types.LinAlgMatrixC10M2N2U1S1 undef, i32 10, i32 2, i32 2, i32 1, i32 1} +// LIB1: ![[TT2]] = !{%dx.types.LinAlgMatrixC10M4N4U1S1 undef, i32 10, i32 4, i32 4, i32 1, i32 1} // Target types in lib2 // LIB2: !dx.targetTypes = !{![[TT3:.*]]} @@ -91,6 +93,6 @@ void CSMain3() { // CSMain3 uses two types of matrices // CSMAIN3: !dx.targetTypes = !{!{{[0-9]+}}, !{{[0-9]+}}} -// CSMAIN3-DAG: !{{[0-9]+}} = !{%dx.types.LinAlgMatrixC10M2N2U1S1 undef, i32 10, i32 2, i32 2, i32 1, i32 1} +// CSMAIN3-DAG: !{{[0-9]+}} = !{%dx.types.LinAlgMatrixC10M4N4U1S1 undef, i32 10, i32 4, i32 4, i32 1, i32 1} // CSMAIN3-DAG: !{{[0-9]+}} = !{%dx.types.LinAlgMatrixC5M6N6U2S2 undef, i32 5, i32 6, i32 6, i32 2, i32 2} -// CSMAIN3-NOT: !{%dx.types.LinAlgMatrixC10M2N2U1S1 +// CSMAIN3-NOT: !{%dx.types.LinAlgMatrixC10M4N4U1S1 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-as.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-as.ll index 47c2f48629..4b2277058f 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-as.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-as.ll @@ -1,22 +1,35 @@ ; REQUIRES: dxil-1-10 ; RUN: not %dxv %s 2>&1 | FileCheck %s -; CHECK: Function: mainAS: error: Opcode LinAlgMatrixMultiply not valid in shader model as_6_10. -; CHECK: Function: mainAS: error: Opcode LinAlgMatrixAccumulate not valid in shader model as_6_10. -; CHECK: Function: mainAS: error: Opcode LinAlgMatrixStoreToDescriptor not valid in shader model as_6_10. -; CHECK: Function: mainAS: error: Opcode LinAlgMatrixLength not valid in shader model as_6_10. -; CHECK: Function: mainAS: error: Opcode LinAlgCopyConvertMatrix not valid in shader model as_6_10. -; CHECK: Function: mainAS: error: Opcode LinAlgFillMatrix not valid in shader model as_6_10. -; CHECK: Function: mainAS: error: Opcode LinAlgMatrixGetCoordinate not valid in shader model as_6_10. -; CHECK: Function: mainAS: error: Opcode LinAlgMatrixGetElement not valid in shader model as_6_10. -; CHECK: Function: mainAS: error: Opcode LinAlgMatrixMultiplyAccumulate not valid in shader model as_6_10. -; CHECK: Function: mainAS: error: Opcode LinAlgMatrixSetElement not valid in shader model as_6_10. -; CHECK: Function: mainAS: error: Opcode LinAlgMatrixStoreToMemory not valid in shader model as_6_10. -; CHECK: Function: mainAS: error: Opcode LinAlgMatrixAccumulateToMemory not valid in shader model as_6_10. -; CHECK: Function: mainAS: error: Opcode LinAlgMatrixLoadFromMemory not valid in shader model as_6_10. -; CHECK: Function: mainAS: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details. -; CHECK: Function: mainAS: error: Function uses features incompatible with the shader stage (as) of the entry function. -; CHECK: Validation failed. +; CHECK: Function: mainAS: error: Opcode LinAlgMatrixMultiply not valid in shader model as_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixMultiply +; CHECK-NEXT: Function: mainAS: error: Opcode LinAlgMatrixAccumulate not valid in shader model as_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixAccumulate +; CHECK-NEXT: Function: mainAS: error: Opcode LinAlgMatrixStoreToDescriptor not valid in shader model as_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixStoreToDescriptor +; CHECK-NEXT: Function: mainAS: error: Opcode LinAlgMatrixLength not valid in shader model as_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLength +; CHECK-NEXT: Function: mainAS: error: Opcode LinAlgCopyConvertMatrix not valid in shader model as_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgCopyConvertMatrix +; CHECK-NEXT: Function: mainAS: error: Opcode LinAlgFillMatrix not valid in shader model as_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgFillMatrix +; CHECK-NEXT: Function: mainAS: error: Opcode LinAlgMatrixGetCoordinate not valid in shader model as_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixGetCoordinate +; CHECK-NEXT: Function: mainAS: error: Opcode LinAlgMatrixGetElement not valid in shader model as_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixGetElement +; CHECK-NEXT: Function: mainAS: error: Opcode LinAlgMatrixMultiplyAccumulate not valid in shader model as_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixMultiplyAccumulate +; CHECK-NEXT: Function: mainAS: error: Opcode LinAlgMatrixSetElement not valid in shader model as_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixSetElement +; CHECK-NEXT: Function: mainAS: error: Opcode LinAlgMatrixStoreToMemory not valid in shader model as_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixStoreToMemory +; CHECK-NEXT: Function: mainAS: error: Opcode LinAlgMatrixAccumulateToMemory not valid in shader model as_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixAccumulateToMemory +; CHECK-NEXT: Function: mainAS: error: Opcode LinAlgMatrixLoadFromMemory not valid in shader model as_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromMemory +; CHECK-NEXT: Function: mainAS: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details. +; CHECK-NEXT: Function: mainAS: error: Function uses features incompatible with the shader stage (as) of the entry function. +; CHECK-NEXT: Validation failed. target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64" target triple = "dxil-ms-dx" @@ -41,14 +54,17 @@ define void @mainAS() { ; Built-ins allowed in all stages ; + %mC4M5N4U0S2 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + %mC4M4N5U1S2 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + ; dx.op.linAlgMatrixAccumulate - %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.LinAlgMatrixC4M4N5U1S2 undef) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) + %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.LinAlgMatrixC4M4N5U1S2 %mC4M4N5U1S2) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) ; dx.op.linAlgMatrixAccumulateToDescriptor - call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) + call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) ; dx.op.linAlgMatrixLength - %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 undef) ; LinAlgMatrixLength(matrix) + %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2) ; LinAlgMatrixLength(matrix) ; dx.op.linAlgMatrixLoadFromDescriptor %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 5, i32 5, i32 5, i32 4) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) @@ -132,6 +148,9 @@ declare i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32, %dx.types.LinAlgMatrixC4M ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32, <4 x i32>, <4 x i32>) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-cs.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-cs.ll index 576758b9b1..886e0129f2 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-cs.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-cs.ll @@ -25,14 +25,17 @@ define void @mainCS() { ; Built-ins allowed in all stages ; + %mC4M5N4U0S2 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + %mC4M4N5U1S2 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + ; dx.op.linAlgMatrixAccumulate - %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.LinAlgMatrixC4M4N5U1S2 undef) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) + %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.LinAlgMatrixC4M4N5U1S2 %mC4M4N5U1S2) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) ; dx.op.linAlgMatrixAccumulateToDescriptor - call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) + call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) ; dx.op.linAlgMatrixLength - %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 undef) ; LinAlgMatrixLength(matrix) + %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2) ; LinAlgMatrixLength(matrix) ; dx.op.linAlgMatrixLoadFromDescriptor %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 5, i32 5, i32 5, i32 4) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) @@ -113,6 +116,9 @@ declare i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32, %dx.types.LinAlgMatrixC4M ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32, <4 x i32>, <4 x i32>) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ds.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ds.ll index c4292d7d7e..c18e863d11 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ds.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ds.ll @@ -1,22 +1,36 @@ ; REQUIRES: dxil-1-10 ; RUN: not %dxv %s 2>&1 | FileCheck %s -; CHECK: Function: MainDS: error: Opcode LinAlgMatrixMultiply not valid in shader model ds_6_10. -; CHECK: Function: MainDS: error: Opcode LinAlgMatrixAccumulate not valid in shader model ds_6_10. -; CHECK: Function: MainDS: error: Opcode LinAlgMatrixStoreToDescriptor not valid in shader model ds_6_10. -; CHECK: Function: MainDS: error: Opcode LinAlgMatrixLength not valid in shader model ds_6_10. -; CHECK: Function: MainDS: error: Opcode LinAlgCopyConvertMatrix not valid in shader model ds_6_10. -; CHECK: Function: MainDS: error: Opcode LinAlgFillMatrix not valid in shader model ds_6_10. -; CHECK: Function: MainDS: error: Opcode LinAlgMatrixGetCoordinate not valid in shader model ds_6_10. -; CHECK: Function: MainDS: error: Opcode LinAlgMatrixGetElement not valid in shader model ds_6_10. -; CHECK: Function: MainDS: error: Opcode LinAlgMatrixMultiplyAccumulate not valid in shader model ds_6_10. -; CHECK: Function: MainDS: error: Opcode LinAlgMatrixSetElement not valid in shader model ds_6_10. -; CHECK: Function: MainDS: error: Opcode LinAlgMatrixStoreToMemory not valid in shader model ds_6_10. -; CHECK: Function: MainDS: error: Opcode LinAlgMatrixAccumulateToMemory not valid in shader model ds_6_10. -; CHECK: Function: MainDS: error: Opcode LinAlgMatrixLoadFromMemory not valid in shader model ds_6_10. -; CHECK: Function: MainDS: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details. -; CHECK: Function: MainDS: error: Function uses features incompatible with the shader stage (ds) of the entry function. -; CHECK: Validation failed. +; CHECK: Function: MainDS: error: Opcode LinAlgMatrixMultiply not valid in shader model ds_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixMultiply +; CHECK-NEXT: Function: MainDS: error: Opcode LinAlgMatrixAccumulate not valid in shader model ds_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixAccumulate +; CHECK-NEXT: Function: MainDS: error: Opcode LinAlgMatrixStoreToDescriptor not valid in shader model ds_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixStoreToDescriptor +; CHECK-NEXT: Function: MainDS: error: Opcode LinAlgMatrixLength not valid in shader model ds_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLength +; CHECK-NEXT: Function: MainDS: error: Opcode LinAlgCopyConvertMatrix not valid in shader model ds_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgCopyConvertMatrix +; CHECK-NEXT: Function: MainDS: error: Opcode LinAlgFillMatrix not valid in shader model ds_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgFillMatrix +; CHECK-NEXT: Function: MainDS: error: Opcode LinAlgMatrixGetCoordinate not valid in shader model ds_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixGetCoordinate +; CHECK-NEXT: Function: MainDS: error: Opcode LinAlgMatrixGetElement not valid in shader model ds_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixGetElement +; CHECK-NEXT: Function: MainDS: error: Opcode LinAlgMatrixMultiplyAccumulate not valid in shader model ds_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixMultiplyAccumulate +; CHECK-NEXT: Function: MainDS: error: Opcode LinAlgMatrixSetElement not valid in shader model ds_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixSetElement +; CHECK-NEXT: Function: MainDS: error: Opcode LinAlgMatrixStoreToMemory not valid in shader model ds_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixStoreToMemory +; CHECK-NEXT: Function: MainDS: error: Opcode LinAlgMatrixAccumulateToMemory not valid in shader model ds_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixAccumulateToMemory +; CHECK-NEXT: Function: MainDS: error: Opcode LinAlgMatrixLoadFromMemory not valid in shader model ds_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromMemory +; CHECK-NEXT: Function: MainDS: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details. +; CHECK-NEXT: Function: MainDS: error: Function uses features incompatible with the shader stage (ds) of the entry function. +; CHECK-NEXT: Function: MainDS: error: Function requires a visible group, but is called from a shader without one. +; CHECK-NEXT: Validation failed. target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64" @@ -41,14 +55,17 @@ define void @MainDS() { ; Built-ins allowed in all stages ; + %mC4M5N4U0S2 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + %mC4M4N5U1S2 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + ; dx.op.linAlgMatrixAccumulate - %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.LinAlgMatrixC4M4N5U1S2 undef) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) + %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.LinAlgMatrixC4M4N5U1S2 %mC4M4N5U1S2) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) ; dx.op.linAlgMatrixAccumulateToDescriptor - call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) + call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) ; dx.op.linAlgMatrixLength - %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 undef) ; LinAlgMatrixLength(matrix) + %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2) ; LinAlgMatrixLength(matrix) ; dx.op.linAlgMatrixLoadFromDescriptor %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 5, i32 5, i32 5, i32 4) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) @@ -137,6 +154,9 @@ declare i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32, %dx.types.LinAlgMatrixC4M ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32, <4 x i32>, <4 x i32>) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-gs.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-gs.ll index d14a983ab4..bf3626c508 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-gs.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-gs.ll @@ -1,22 +1,36 @@ ; REQUIRES: dxil-1-10 ; RUN: not %dxv %s 2>&1 | FileCheck %s -; CHECK: Function: MainGS: error: Opcode LinAlgMatrixMultiply not valid in shader model gs_6_10. -; CHECK: Function: MainGS: error: Opcode LinAlgMatrixAccumulate not valid in shader model gs_6_10. -; CHECK: Function: MainGS: error: Opcode LinAlgMatrixStoreToDescriptor not valid in shader model gs_6_10. -; CHECK: Function: MainGS: error: Opcode LinAlgMatrixLength not valid in shader model gs_6_10. -; CHECK: Function: MainGS: error: Opcode LinAlgCopyConvertMatrix not valid in shader model gs_6_10. -; CHECK: Function: MainGS: error: Opcode LinAlgFillMatrix not valid in shader model gs_6_10. -; CHECK: Function: MainGS: error: Opcode LinAlgMatrixGetCoordinate not valid in shader model gs_6_10. -; CHECK: Function: MainGS: error: Opcode LinAlgMatrixGetElement not valid in shader model gs_6_10. -; CHECK: Function: MainGS: error: Opcode LinAlgMatrixMultiplyAccumulate not valid in shader model gs_6_10. -; CHECK: Function: MainGS: error: Opcode LinAlgMatrixSetElement not valid in shader model gs_6_10. -; CHECK: Function: MainGS: error: Opcode LinAlgMatrixStoreToMemory not valid in shader model gs_6_10. -; CHECK: Function: MainGS: error: Opcode LinAlgMatrixAccumulateToMemory not valid in shader model gs_6_10. -; CHECK: Function: MainGS: error: Opcode LinAlgMatrixLoadFromMemory not valid in shader model gs_6_10. -; CHECK: Function: MainGS: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details. -; CHECK: Function: MainGS: error: Function uses features incompatible with the shader stage (gs) of the entry function. -; CHECK: Validation failed. +; CHECK: Function: MainGS: error: Opcode LinAlgMatrixMultiply not valid in shader model gs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixMultiply +; CHECK-NEXT: Function: MainGS: error: Opcode LinAlgMatrixAccumulate not valid in shader model gs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixAccumulate +; CHECK-NEXT: Function: MainGS: error: Opcode LinAlgMatrixStoreToDescriptor not valid in shader model gs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixStoreToDescriptor +; CHECK-NEXT: Function: MainGS: error: Opcode LinAlgMatrixLength not valid in shader model gs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLength +; CHECK-NEXT: Function: MainGS: error: Opcode LinAlgCopyConvertMatrix not valid in shader model gs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgCopyConvertMatrix +; CHECK-NEXT: Function: MainGS: error: Opcode LinAlgFillMatrix not valid in shader model gs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgFillMatrix +; CHECK-NEXT: Function: MainGS: error: Opcode LinAlgMatrixGetCoordinate not valid in shader model gs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixGetCoordinate +; CHECK-NEXT: Function: MainGS: error: Opcode LinAlgMatrixGetElement not valid in shader model gs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixGetElement +; CHECK-NEXT: Function: MainGS: error: Opcode LinAlgMatrixMultiplyAccumulate not valid in shader model gs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixMultiplyAccumulate +; CHECK-NEXT: Function: MainGS: error: Opcode LinAlgMatrixSetElement not valid in shader model gs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixSetElement +; CHECK-NEXT: Function: MainGS: error: Opcode LinAlgMatrixStoreToMemory not valid in shader model gs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixStoreToMemory +; CHECK-NEXT: Function: MainGS: error: Opcode LinAlgMatrixAccumulateToMemory not valid in shader model gs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixAccumulateToMemory +; CHECK-NEXT: Function: MainGS: error: Opcode LinAlgMatrixLoadFromMemory not valid in shader model gs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromMemory +; CHECK-NEXT: Function: MainGS: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details. +; CHECK-NEXT: Function: MainGS: error: Function uses features incompatible with the shader stage (gs) of the entry function. +; CHECK-NEXT: Function: MainGS: error: Function requires a visible group, but is called from a shader without one. +; CHECK-NEXT: Validation failed. target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64" @@ -41,14 +55,17 @@ define void @MainGS() { ; Built-ins allowed in all stages ; + %mC4M5N4U0S2 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + %mC4M4N5U1S2 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + ; dx.op.linAlgMatrixAccumulate - %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.LinAlgMatrixC4M4N5U1S2 undef) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) + %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.LinAlgMatrixC4M4N5U1S2 %mC4M4N5U1S2) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) ; dx.op.linAlgMatrixAccumulateToDescriptor - call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) + call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) ; dx.op.linAlgMatrixLength - %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 undef) ; LinAlgMatrixLength(matrix) + %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2) ; LinAlgMatrixLength(matrix) ; dx.op.linAlgMatrixLoadFromDescriptor %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 5, i32 5, i32 5, i32 4) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) @@ -136,6 +153,9 @@ declare i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32, %dx.types.LinAlgMatrixC4M ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32, <4 x i32>, <4 x i32>) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-hs.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-hs.ll index c5411b9b2e..67d3f03386 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-hs.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-hs.ll @@ -1,23 +1,36 @@ ; REQUIRES: dxil-1-10 ; RUN: not %dxv %s 2>&1 | FileCheck %s -; CHECK: Function: MainHS: error: Opcode LinAlgMatrixMultiply not valid in shader model hs_6_10. -; CHECK: Function: MainHS: error: Opcode LinAlgMatrixAccumulate not valid in shader model hs_6_10. -; CHECK: Function: MainHS: error: Opcode LinAlgMatrixStoreToDescriptor not valid in shader model hs_6_10. -; CHECK: Function: MainHS: error: Opcode LinAlgMatrixLength not valid in shader model hs_6_10. -; CHECK: Function: MainHS: error: Opcode LinAlgCopyConvertMatrix not valid in shader model hs_6_10. -; CHECK: Function: MainHS: error: Opcode LinAlgFillMatrix not valid in shader model hs_6_10. -; CHECK: Function: MainHS: error: Opcode LinAlgMatrixGetCoordinate not valid in shader model hs_6_10. -; CHECK: Function: MainHS: error: Opcode LinAlgMatrixGetElement not valid in shader model hs_6_10. -; CHECK: Function: MainHS: error: Opcode LinAlgMatrixMultiplyAccumulate not valid in shader model hs_6_10. -; CHECK: Function: MainHS: error: Opcode LinAlgMatrixSetElement not valid in shader model hs_6_10. -; CHECK: Function: MainHS: error: Opcode LinAlgMatrixStoreToMemory not valid in shader model hs_6_10. -; CHECK: Function: MainHS: error: Opcode LinAlgMatrixAccumulateToMemory not valid in shader model hs_6_10. -; CHECK: Function: MainHS: error: Opcode LinAlgMatrixLoadFromMemory not valid in shader model hs_6_10. -; CHECK: Function: MainHS: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details. -; CHECK: Function: MainHS: error: Function uses features incompatible with the shader stage (hs) of the entry function. -; CHECK: Validation failed. - +; CHECK: Function: MainHS: error: Opcode LinAlgMatrixMultiply not valid in shader model hs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixMultiply +; CHECK-NEXT: Function: MainHS: error: Opcode LinAlgMatrixAccumulate not valid in shader model hs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixAccumulate +; CHECK-NEXT: Function: MainHS: error: Opcode LinAlgMatrixStoreToDescriptor not valid in shader model hs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixStoreToDescriptor +; CHECK-NEXT: Function: MainHS: error: Opcode LinAlgMatrixLength not valid in shader model hs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLength +; CHECK-NEXT: Function: MainHS: error: Opcode LinAlgCopyConvertMatrix not valid in shader model hs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgCopyConvertMatrix +; CHECK-NEXT: Function: MainHS: error: Opcode LinAlgFillMatrix not valid in shader model hs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgFillMatrix +; CHECK-NEXT: Function: MainHS: error: Opcode LinAlgMatrixGetCoordinate not valid in shader model hs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixGetCoordinate +; CHECK-NEXT: Function: MainHS: error: Opcode LinAlgMatrixGetElement not valid in shader model hs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixGetElement +; CHECK-NEXT: Function: MainHS: error: Opcode LinAlgMatrixMultiplyAccumulate not valid in shader model hs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixMultiplyAccumulate +; CHECK-NEXT: Function: MainHS: error: Opcode LinAlgMatrixSetElement not valid in shader model hs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixSetElement +; CHECK-NEXT: Function: MainHS: error: Opcode LinAlgMatrixStoreToMemory not valid in shader model hs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixStoreToMemory +; CHECK-NEXT: Function: MainHS: error: Opcode LinAlgMatrixAccumulateToMemory not valid in shader model hs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixAccumulateToMemory +; CHECK-NEXT: Function: MainHS: error: Opcode LinAlgMatrixLoadFromMemory not valid in shader model hs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromMemory +; CHECK-NEXT: Function: MainHS: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details. +; CHECK-NEXT: Function: MainHS: error: Function uses features incompatible with the shader stage (hs) of the entry function. +; CHECK-NEXT: Function: MainHS: error: Function requires a visible group, but is called from a shader without one. +; CHECK-NEXT: Validation failed. target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64" target triple = "dxil-ms-dx" @@ -41,14 +54,17 @@ define void @MainHS() { ; Built-ins allowed in all stages ; + %mC4M5N4U0S2 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + %mC4M4N5U1S2 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + ; dx.op.linAlgMatrixAccumulate - %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.LinAlgMatrixC4M4N5U1S2 undef) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) + %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.LinAlgMatrixC4M4N5U1S2 %mC4M4N5U1S2) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) ; dx.op.linAlgMatrixAccumulateToDescriptor - call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) + call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) ; dx.op.linAlgMatrixLength - %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 undef) ; LinAlgMatrixLength(matrix) + %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2) ; LinAlgMatrixLength(matrix) ; dx.op.linAlgMatrixLoadFromDescriptor %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 5, i32 5, i32 5, i32 4) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) @@ -142,6 +158,9 @@ declare i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32, %dx.types.LinAlgMatrixC4M ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32, <4 x i32>, <4 x i32>) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-max-k-dim.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-max-k-dim.ll new file mode 100644 index 0000000000..eead28e296 --- /dev/null +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-max-k-dim.ll @@ -0,0 +1,231 @@ +; REQUIRES: dxil-1-10 +; RUN: not %dxv %s 2>&1 | FileCheck %s + +target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64" +target triple = "dxil-ms-dx" + +%dx.types.Handle = type { i8* } +%dx.types.ResBind = type { i32, i32, i32, i8 } +%dx.types.LinAlgMatrixC4M16N16U0S2 = type { i8* } +%dx.types.LinAlgMatrixC8M1025N1025U2S0 = type { i8* } +%dx.types.LinAlgMatrixC8M16N129U0S0 = type { i8* } +%dx.types.LinAlgMatrixC8M129N16U0S0 = type { i8* } +%dx.types.LinAlgMatrixC8M16N3U0S0 = type { i8* } +%dx.types.LinAlgMatrixC8M3N16U0S0 = type { i8* } +%dx.types.LinAlgMatrixC8M16N129U1S0 = type { i8* } +%dx.types.LinAlgMatrixC8M129N16U1S0 = type { i8* } +%dx.types.LinAlgMatrixC8M16N3U1S0 = type { i8* } +%dx.types.LinAlgMatrixC8M3N16U1S0 = type { i8* } +%dx.types.LinAlgMatrixC8M16N1025U0S2 = type { i8* } +%dx.types.LinAlgMatrixC8M1025N16U0S2 = type { i8* } +%dx.types.LinAlgMatrixC8M16N3U0S2 = type { i8* } +%dx.types.LinAlgMatrixC8M3N16U0S2 = type { i8* } +%dx.types.LinAlgMatrixC8M129N1025U1S2 = type { i8* } +%dx.types.LinAlgMatrixC8M1025N129U1S2 = type { i8* } +%dx.types.LinAlgMatrixC8M129N3U1S2 = type { i8* } +%dx.types.LinAlgMatrixC8M3N129U1S2 = type { i8* } +%dx.types.LinAlgMatrixC8M128N128U0S0 = type { i8* } +%dx.types.LinAlgMatrixC8M128N128U1S0 = type { i8* } +%dx.types.LinAlgMatrixC8M1024N1024U0S2 = type { i8* } +%dx.types.LinAlgMatrixC8M1024N1024U1S2 = type { i8* } +%dx.types.ResourceProperties = type { i32, i32 } +%struct.RWByteAddressBuffer = type { i32 } + +define void @main() { + %1 = call %dx.types.Handle @dx.op.createHandleFromBinding(i32 217, %dx.types.ResBind { i32 0, i32 0, i32 0, i8 1 }, i32 0, i1 false) ; CreateHandleFromBinding(bind,index,nonUniformIndex) + %handle = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 4107, i32 0 }) ; AnnotateHandle(res,props) resource: RWByteAddressBuffer + + ; Matrix - its not possible to statically determine which dim is K on Accumulator so no validation occurs + %mC8M1025N1025U2S0 = call %dx.types.LinAlgMatrixC8M1025N1025U2S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M1025N1025U2S0(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + + ; CHECK: Function: main: error: Metadata must be well-formed in operand count and types. + ; CHECK-NEXT: note: at '%mC4M16N16U0S2 + ; Matrix - missing metadata + %mC4M16N16U0S2 = call %dx.types.LinAlgMatrixC4M16N16U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M16N16U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + + ; CHECK-NEXT: Function: main: error: Matrix K Dimension out of bounds. K=129 must be >= 4 and <= 128. + ; CHECK-NEXT: note: at '%mC8M16N129U0S0 + ; Matrix - N is K so pass + %mC8M129N16U0S0 = call %dx.types.LinAlgMatrixC8M129N16U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M129N16U0S0(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + ; Matrix - N is K so fail + %mC8M16N129U0S0 = call %dx.types.LinAlgMatrixC8M16N129U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N129U0S0(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + + ; CHECK-NEXT: Function: main: error: Matrix K Dimension out of bounds. K=3 must be >= 4 and <= 128. + ; CHECK-NEXT: note: at '%mC8M16N3U0S0 + ; Matrix - N is K so pass + %mC8M3N16U0S0 = call %dx.types.LinAlgMatrixC8M3N16U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M3N16U0S0(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + ; Matrix - N is K so fail + %mC8M16N3U0S0 = call %dx.types.LinAlgMatrixC8M16N3U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N3U0S0(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + + ; CHECK-NEXT: Function: main: error: Matrix K Dimension out of bounds. K=129 must be >= 4 and <= 128. + ; CHECK-NEXT: note: at '%mC8M129N16U1S0 + ; Matrix - M is K so fail + %mC8M129N16U1S0 = call %dx.types.LinAlgMatrixC8M129N16U1S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M129N16U1S0(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + ; Matrix - M is K so pass + %mC8M16N129U1S0 = call %dx.types.LinAlgMatrixC8M16N129U1S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N129U1S0(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + + ; CHECK-NEXT: Function: main: error: Matrix K Dimension out of bounds. K=3 must be >= 4 and <= 128. + ; CHECK-NEXT: note: at '%mC8M3N16U1S0 + ; Matrix - M is K so fail + %mC8M3N16U1S0 = call %dx.types.LinAlgMatrixC8M3N16U1S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M3N16U1S0(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + ; Matrix - M is K so pass + %mC8M16N3U1S0 = call %dx.types.LinAlgMatrixC8M16N3U1S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N3U1S0(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + + ; CHECK-NEXT: Function: main: error: Matrix K Dimension out of bounds. K=1025 must be >= 4 and <= 1024. + ; CHECK-NEXT: note: at '%mC8M16N1025U0S2 + ; Matrix - N is K so pass + %mC8M1025N16U0S2 = call %dx.types.LinAlgMatrixC8M1025N16U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M1025N16U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + ; Matrix - N is K so fail + %mC8M16N1025U0S2 = call %dx.types.LinAlgMatrixC8M16N1025U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N1025U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + + ; CHECK-NEXT: Function: main: error: Matrix K Dimension out of bounds. K=3 must be >= 4 and <= 1024. + ; CHECK-NEXT: note: at '%mC8M16N3U0S2 + ; Matrix - N is K so fail + %mC8M16N3U0S2 = call %dx.types.LinAlgMatrixC8M16N3U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N3U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + ; Matrix - N is K so pass + %mC8M3N16U0S2 = call %dx.types.LinAlgMatrixC8M3N16U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M3N16U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + + ; CHECK-NEXT: Function: main: error: Matrix K Dimension out of bounds. K=1025 must be >= 4 and <= 1024. + ; CHECK-NEXT: note: at '%mC8M1025N129U1S2 + ; Matrix - M is K so fail + %mC8M1025N129U1S2 = call %dx.types.LinAlgMatrixC8M1025N129U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M1025N129U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + ; Matrix - M is K so pass + %mC8M129N1025U1S2 = call %dx.types.LinAlgMatrixC8M129N1025U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M129N1025U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + + ; CHECK-NEXT: Function: main: error: Matrix K Dimension out of bounds. K=3 must be >= 4 and <= 1024. + ; CHECK-NEXT: note: at '%mC8M3N129U1S2 + ; Matrix - M is K so fail + %mC8M3N129U1S2 = call %dx.types.LinAlgMatrixC8M3N129U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M3N129U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + ; Matrix - M is K so pass + %mC8M129N3U1S2 = call %dx.types.LinAlgMatrixC8M129N3U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M129N3U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + + + ; Below are just barely in bounds. No validation errors should be emitted. + + ; Matrix + %mC8M128N128U0S0 = call %dx.types.LinAlgMatrixC8M128N128U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M128N128U0S0(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + ; Matrix + %mC8M128N128U1S0 = call %dx.types.LinAlgMatrixC8M128N128U1S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M128N128U1S0(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + ; Matrix + %mC8M1024N1024U0S2 = call %dx.types.LinAlgMatrixC8M1024N1024U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M1024N1024U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + ; Matrix + %mC8M1024N1024U1S2 = call %dx.types.LinAlgMatrixC8M1024N1024U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M1024N1024U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + + ; CHECK-NEXT: Validation failed. + + ret void +} + +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC4M16N16U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M16N16U0S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC8M1025N1025U2S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M1025N1025U2S0(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC8M16N129U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N129U0S0(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC8M129N16U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M129N16U0S0(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC8M16N3U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N3U0S0(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC8M3N16U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M3N16U0S0(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC8M16N129U1S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N129U1S0(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC8M129N16U1S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M129N16U1S0(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC8M16N3U1S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N3U1S0(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC8M3N16U1S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M3N16U1S0(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC8M16N1025U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N1025U0S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC8M1025N16U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M1025N16U0S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC8M16N3U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N3U0S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC8M3N16U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M3N16U0S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC8M129N1025U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M129N1025U1S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC8M1025N129U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M1025N129U1S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC8M129N3U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M129N3U1S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC8M3N129U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M3N129U1S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC8M128N128U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M128N128U0S0(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC8M128N128U1S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M128N128U1S0(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC8M1024N1024U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M1024N1024U0S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC8M1024N1024U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M1024N1024U1S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + +; Function Attrs: nounwind readnone +declare %dx.types.Handle @dx.op.annotateHandle(i32, %dx.types.Handle, %dx.types.ResourceProperties) #1 + +; Function Attrs: nounwind readnone +declare %dx.types.Handle @dx.op.createHandleFromBinding(i32, %dx.types.ResBind, i32, i1) #1 + +attributes #0 = { nounwind } +attributes #1 = { nounwind readnone } + +!dx.targetTypes = !{!0,!1,!2,!3,!4,!5,!6,!7,!8,!9,!10,!11,!12,!13,!14,!15,!16,!26,!27,!28,!29} +!llvm.ident = !{!17} +!dx.version = !{!18} +!dx.valver = !{!18} +!dx.shaderModel = !{!19} +!dx.resources = !{!20} +!dx.entryPoints = !{!23} + +!0 = !{%dx.types.LinAlgMatrixC8M1025N1025U2S0 undef, i32 8, i32 1025, i32 1025, i32 2, i32 0} +!1 = !{%dx.types.LinAlgMatrixC8M16N129U0S0 undef, i32 8, i32 16, i32 129, i32 0, i32 0} +!2 = !{%dx.types.LinAlgMatrixC8M129N16U0S0 undef, i32 8, i32 129, i32 16, i32 0, i32 0} +!3 = !{%dx.types.LinAlgMatrixC8M16N3U0S0 undef, i32 8, i32 16, i32 3, i32 0, i32 0} +!4 = !{%dx.types.LinAlgMatrixC8M3N16U0S0 undef, i32 8, i32 3, i32 16, i32 0, i32 0} +!5 = !{%dx.types.LinAlgMatrixC8M16N129U1S0 undef, i32 8, i32 16, i32 129, i32 1, i32 0} +!6 = !{%dx.types.LinAlgMatrixC8M129N16U1S0 undef, i32 8, i32 129, i32 16, i32 1, i32 0} +!7 = !{%dx.types.LinAlgMatrixC8M16N3U1S0 undef, i32 8, i32 16, i32 3, i32 1, i32 0} +!8 = !{%dx.types.LinAlgMatrixC8M3N16U1S0 undef, i32 8, i32 3, i32 16, i32 1, i32 0} +!9 = !{%dx.types.LinAlgMatrixC8M16N1025U0S2 undef, i32 8, i32 16, i32 1025, i32 0, i32 2} +!10 = !{%dx.types.LinAlgMatrixC8M1025N16U0S2 undef, i32 8, i32 1025, i32 16, i32 0, i32 2} +!11 = !{%dx.types.LinAlgMatrixC8M16N3U0S2 undef, i32 8, i32 16, i32 3, i32 0, i32 2} +!12 = !{%dx.types.LinAlgMatrixC8M3N16U0S2 undef, i32 8, i32 3, i32 16, i32 0, i32 2} +!13 = !{%dx.types.LinAlgMatrixC8M129N1025U1S2 undef, i32 8, i32 129, i32 1025, i32 1, i32 2} +!14 = !{%dx.types.LinAlgMatrixC8M1025N129U1S2 undef, i32 8, i32 1025, i32 129, i32 1, i32 2} +!15 = !{%dx.types.LinAlgMatrixC8M129N3U1S2 undef, i32 8, i32 129, i32 3, i32 1, i32 2} +!16 = !{%dx.types.LinAlgMatrixC8M3N129U1S2 undef, i32 8, i32 3, i32 129, i32 1, i32 2} +!17 = !{!"dxc(private) 1.9.0.15241 (main, 1f63535ae)"} +!18 = !{i32 1, i32 10} +!19 = !{!"cs", i32 6, i32 10} +!20 = !{null, !21, null, null} +!21 = !{!22} +!22 = !{i32 0, %struct.RWByteAddressBuffer* undef, !"", i32 0, i32 0, i32 1, i32 11, i1 false, i1 false, i1 false, null} +!23 = !{void ()* @main, !"main", null, !20, !24} +!24 = !{i32 0, i64 8589934608, i32 4, !25} +!25 = !{i32 4, i32 4, i32 4} +!26 = !{%dx.types.LinAlgMatrixC8M128N128U0S0 undef, i32 8, i32 128, i32 128, i32 0, i32 0} +!27 = !{%dx.types.LinAlgMatrixC8M128N128U1S0 undef, i32 8, i32 128, i32 128, i32 1, i32 0} +!28 = !{%dx.types.LinAlgMatrixC8M1024N1024U0S2 undef, i32 8, i32 1024, i32 1024, i32 0, i32 2} +!29 = !{%dx.types.LinAlgMatrixC8M1024N1024U1S2 undef, i32 8, i32 1024, i32 1024, i32 1, i32 2} diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ms.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ms.ll index 1575754a90..02b4744df3 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ms.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ms.ll @@ -1,22 +1,35 @@ ; REQUIRES: dxil-1-10 ; RUN: not %dxv %s 2>&1 | FileCheck %s -; CHECK: Function: mainMeS: error: Opcode LinAlgMatrixMultiply not valid in shader model ms_6_10. -; CHECK: Function: mainMeS: error: Opcode LinAlgMatrixAccumulate not valid in shader model ms_6_10. -; CHECK: Function: mainMeS: error: Opcode LinAlgMatrixStoreToDescriptor not valid in shader model ms_6_10. -; CHECK: Function: mainMeS: error: Opcode LinAlgMatrixLength not valid in shader model ms_6_10. -; CHECK: Function: mainMeS: error: Opcode LinAlgCopyConvertMatrix not valid in shader model ms_6_10. -; CHECK: Function: mainMeS: error: Opcode LinAlgFillMatrix not valid in shader model ms_6_10. -; CHECK: Function: mainMeS: error: Opcode LinAlgMatrixGetCoordinate not valid in shader model ms_6_10. -; CHECK: Function: mainMeS: error: Opcode LinAlgMatrixGetElement not valid in shader model ms_6_10. -; CHECK: Function: mainMeS: error: Opcode LinAlgMatrixMultiplyAccumulate not valid in shader model ms_6_10. -; CHECK: Function: mainMeS: error: Opcode LinAlgMatrixSetElement not valid in shader model ms_6_10. -; CHECK: Function: mainMeS: error: Opcode LinAlgMatrixStoreToMemory not valid in shader model ms_6_10. -; CHECK: Function: mainMeS: error: Opcode LinAlgMatrixAccumulateToMemory not valid in shader model ms_6_10. -; CHECK: Function: mainMeS: error: Opcode LinAlgMatrixLoadFromMemory not valid in shader model ms_6_10. -; CHECK: Function: mainMeS: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details. -; CHECK: Function: mainMeS: error: Function uses features incompatible with the shader stage (ms) of the entry function. -; CHECK: Validation failed. +; CHECK: Function: mainMeS: error: Opcode LinAlgMatrixMultiply not valid in shader model ms_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixMultiply +; CHECK-NEXT: Function: mainMeS: error: Opcode LinAlgMatrixAccumulate not valid in shader model ms_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixAccumulate +; CHECK-NEXT: Function: mainMeS: error: Opcode LinAlgMatrixStoreToDescriptor not valid in shader model ms_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixStoreToDescriptor +; CHECK-NEXT: Function: mainMeS: error: Opcode LinAlgMatrixLength not valid in shader model ms_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLength +; CHECK-NEXT: Function: mainMeS: error: Opcode LinAlgCopyConvertMatrix not valid in shader model ms_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgCopyConvertMatrix +; CHECK-NEXT: Function: mainMeS: error: Opcode LinAlgFillMatrix not valid in shader model ms_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgFillMatrix +; CHECK-NEXT: Function: mainMeS: error: Opcode LinAlgMatrixGetCoordinate not valid in shader model ms_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixGetCoordinate +; CHECK-NEXT: Function: mainMeS: error: Opcode LinAlgMatrixGetElement not valid in shader model ms_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixGetElement +; CHECK-NEXT: Function: mainMeS: error: Opcode LinAlgMatrixMultiplyAccumulate not valid in shader model ms_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixMultiplyAccumulate +; CHECK-NEXT: Function: mainMeS: error: Opcode LinAlgMatrixSetElement not valid in shader model ms_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixSetElement +; CHECK-NEXT: Function: mainMeS: error: Opcode LinAlgMatrixStoreToMemory not valid in shader model ms_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixStoreToMemory +; CHECK-NEXT: Function: mainMeS: error: Opcode LinAlgMatrixAccumulateToMemory not valid in shader model ms_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixAccumulateToMemory +; CHECK-NEXT: Function: mainMeS: error: Opcode LinAlgMatrixLoadFromMemory not valid in shader model ms_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromMemory +; CHECK-NEXT: Function: mainMeS: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details. +; CHECK-NEXT: Function: mainMeS: error: Function uses features incompatible with the shader stage (ms) of the entry function. +; CHECK-NEXT: Validation failed. target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64" target triple = "dxil-ms-dx" @@ -41,14 +54,17 @@ define void @mainMeS() { ; Built-ins allowed in all stages ; + %mC4M5N4U0S2 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + %mC4M4N5U1S2 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + ; dx.op.linAlgMatrixAccumulate - %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.LinAlgMatrixC4M4N5U1S2 undef) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) + %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.LinAlgMatrixC4M4N5U1S2 %mC4M4N5U1S2) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) ; dx.op.linAlgMatrixAccumulateToDescriptor - call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) + call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) ; dx.op.linAlgMatrixLength - %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 undef) ; LinAlgMatrixLength(matrix) + %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2) ; LinAlgMatrixLength(matrix) ; dx.op.linAlgMatrixLoadFromDescriptor %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 5, i32 5, i32 5, i32 4) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) @@ -135,6 +151,9 @@ declare i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32, %dx.types.LinAlgMatrixC4M ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32, <4 x i32>, <4 x i32>) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-node.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-node.ll index 1318eb5435..5e5c9f270c 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-node.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-node.ll @@ -1,22 +1,35 @@ ; REQUIRES: dxil-1-10 ; RUN: not %dxv %s 2>&1 | FileCheck %s -; CHECK: Function: mainNS: error: Opcode LinAlgMatrixMultiply not valid in shader model lib_6_10(node). -; CHECK: Function: mainNS: error: Opcode LinAlgMatrixAccumulate not valid in shader model lib_6_10(node). -; CHECK: Function: mainNS: error: Opcode LinAlgMatrixStoreToDescriptor not valid in shader model lib_6_10(node). -; CHECK: Function: mainNS: error: Opcode LinAlgMatrixLength not valid in shader model lib_6_10(node). -; CHECK: Function: mainNS: error: Opcode LinAlgCopyConvertMatrix not valid in shader model lib_6_10(node). -; CHECK: Function: mainNS: error: Opcode LinAlgFillMatrix not valid in shader model lib_6_10(node). -; CHECK: Function: mainNS: error: Opcode LinAlgMatrixGetCoordinate not valid in shader model lib_6_10(node). -; CHECK: Function: mainNS: error: Opcode LinAlgMatrixGetElement not valid in shader model lib_6_10(node). -; CHECK: Function: mainNS: error: Opcode LinAlgMatrixMultiplyAccumulate not valid in shader model lib_6_10(node). -; CHECK: Function: mainNS: error: Opcode LinAlgMatrixSetElement not valid in shader model lib_6_10(node). -; CHECK: Function: mainNS: error: Opcode LinAlgMatrixStoreToMemory not valid in shader model lib_6_10(node). -; CHECK: Function: mainNS: error: Opcode LinAlgMatrixAccumulateToMemory not valid in shader model lib_6_10(node). -; CHECK: Function: mainNS: error: Opcode LinAlgMatrixLoadFromMemory not valid in shader model lib_6_10(node). -; CHECK: Function: mainNS: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details. -; CHECK: Function: mainNS: error: Function uses features incompatible with the shader stage (node) of the entry function. -; CHECK: Validation failed. +; CHECK: Function: mainNS: error: Opcode LinAlgMatrixMultiply not valid in shader model lib_6_10(node). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixMultiply +; CHECK-NEXT: Function: mainNS: error: Opcode LinAlgMatrixAccumulate not valid in shader model lib_6_10(node). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixAccumulate +; CHECK-NEXT: Function: mainNS: error: Opcode LinAlgMatrixStoreToDescriptor not valid in shader model lib_6_10(node). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixStoreToDescriptor +; CHECK-NEXT: Function: mainNS: error: Opcode LinAlgMatrixLength not valid in shader model lib_6_10(node). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLength +; CHECK-NEXT: Function: mainNS: error: Opcode LinAlgCopyConvertMatrix not valid in shader model lib_6_10(node). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgCopyConvertMatrix +; CHECK-NEXT: Function: mainNS: error: Opcode LinAlgFillMatrix not valid in shader model lib_6_10(node). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgFillMatrix +; CHECK-NEXT: Function: mainNS: error: Opcode LinAlgMatrixGetCoordinate not valid in shader model lib_6_10(node). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixGetCoordinate +; CHECK-NEXT: Function: mainNS: error: Opcode LinAlgMatrixGetElement not valid in shader model lib_6_10(node). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixGetElement +; CHECK-NEXT: Function: mainNS: error: Opcode LinAlgMatrixMultiplyAccumulate not valid in shader model lib_6_10(node). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixMultiplyAccumulate +; CHECK-NEXT: Function: mainNS: error: Opcode LinAlgMatrixSetElement not valid in shader model lib_6_10(node). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixSetElement +; CHECK-NEXT: Function: mainNS: error: Opcode LinAlgMatrixStoreToMemory not valid in shader model lib_6_10(node). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixStoreToMemory +; CHECK-NEXT: Function: mainNS: error: Opcode LinAlgMatrixAccumulateToMemory not valid in shader model lib_6_10(node). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixAccumulateToMemory +; CHECK-NEXT: Function: mainNS: error: Opcode LinAlgMatrixLoadFromMemory not valid in shader model lib_6_10(node). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromMemory +; CHECK-NEXT: Function: mainNS: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details. +; CHECK-NEXT: Function: mainNS: error: Function uses features incompatible with the shader stage (node) of the entry function. +; CHECK-NEXT: Validation failed. target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64" @@ -42,14 +55,17 @@ define void @mainNS() { ; Built-ins allowed in all stages ; + %mC4M5N4U0S2 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + %mC4M4N5U1S2 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + ; dx.op.linAlgMatrixAccumulate - %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.LinAlgMatrixC4M4N5U1S2 undef) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) + %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.LinAlgMatrixC4M4N5U1S2 %mC4M4N5U1S2) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) ; dx.op.linAlgMatrixAccumulateToDescriptor - call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) + call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) ; dx.op.linAlgMatrixLength - %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 undef) ; LinAlgMatrixLength(matrix) + %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2) ; LinAlgMatrixLength(matrix) ; dx.op.linAlgMatrixLoadFromDescriptor %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 5, i32 5, i32 5, i32 4) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) @@ -130,6 +146,9 @@ declare i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32, %dx.types.LinAlgMatrixC4M ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32, <4 x i32>, <4 x i32>) #0 @@ -181,9 +200,6 @@ declare %dx.types.Handle @dx.op.annotateHandle(i32, %dx.types.Handle, %dx.types. ; Function Attrs: nounwind readnone declare %dx.types.Handle @dx.op.createHandleFromBinding(i32, %dx.types.ResBind, i32, i1) #1 -; Function Attrs: nounwind -declare void @dx.op.storeOutput.f32(i32, i32, i32, i8, float) #0 - attributes #0 = { nounwind } attributes #1 = { nounwind readnone } attributes #2 = { nounwind readonly } diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ps.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ps.ll index 676f573fb5..0464eff737 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ps.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ps.ll @@ -1,22 +1,36 @@ ; REQUIRES: dxil-1-10 ; RUN: not %dxv %s 2>&1 | FileCheck %s -; CHECK: Function: mainPS: error: Opcode LinAlgMatrixMultiply not valid in shader model ps_6_10. -; CHECK: Function: mainPS: error: Opcode LinAlgMatrixAccumulate not valid in shader model ps_6_10. -; CHECK: Function: mainPS: error: Opcode LinAlgMatrixStoreToDescriptor not valid in shader model ps_6_10. -; CHECK: Function: mainPS: error: Opcode LinAlgMatrixLength not valid in shader model ps_6_10. -; CHECK: Function: mainPS: error: Opcode LinAlgCopyConvertMatrix not valid in shader model ps_6_10. -; CHECK: Function: mainPS: error: Opcode LinAlgFillMatrix not valid in shader model ps_6_10. -; CHECK: Function: mainPS: error: Opcode LinAlgMatrixGetCoordinate not valid in shader model ps_6_10. -; CHECK: Function: mainPS: error: Opcode LinAlgMatrixGetElement not valid in shader model ps_6_10. -; CHECK: Function: mainPS: error: Opcode LinAlgMatrixMultiplyAccumulate not valid in shader model ps_6_10. -; CHECK: Function: mainPS: error: Opcode LinAlgMatrixSetElement not valid in shader model ps_6_10. -; CHECK: Function: mainPS: error: Opcode LinAlgMatrixStoreToMemory not valid in shader model ps_6_10. -; CHECK: Function: mainPS: error: Opcode LinAlgMatrixAccumulateToMemory not valid in shader model ps_6_10. -; CHECK: Function: mainPS: error: Opcode LinAlgMatrixLoadFromMemory not valid in shader model ps_6_10. -; CHECK: Function: mainPS: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details. -; CHECK: Function: mainPS: error: Function uses features incompatible with the shader stage (ps) of the entry function. -; CHECK: Validation failed. +; CHECK: Function: mainPS: error: Opcode LinAlgMatrixMultiply not valid in shader model ps_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixMultiply +; CHECK-NEXT: Function: mainPS: error: Opcode LinAlgMatrixAccumulate not valid in shader model ps_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixAccumulate +; CHECK-NEXT: Function: mainPS: error: Opcode LinAlgMatrixStoreToDescriptor not valid in shader model ps_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixStoreToDescriptor +; CHECK-NEXT: Function: mainPS: error: Opcode LinAlgMatrixLength not valid in shader model ps_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLength +; CHECK-NEXT: Function: mainPS: error: Opcode LinAlgCopyConvertMatrix not valid in shader model ps_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgCopyConvertMatrix +; CHECK-NEXT: Function: mainPS: error: Opcode LinAlgFillMatrix not valid in shader model ps_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgFillMatrix +; CHECK-NEXT: Function: mainPS: error: Opcode LinAlgMatrixGetCoordinate not valid in shader model ps_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixGetCoordinate +; CHECK-NEXT: Function: mainPS: error: Opcode LinAlgMatrixGetElement not valid in shader model ps_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixGetElement +; CHECK-NEXT: Function: mainPS: error: Opcode LinAlgMatrixMultiplyAccumulate not valid in shader model ps_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixMultiplyAccumulate +; CHECK-NEXT: Function: mainPS: error: Opcode LinAlgMatrixSetElement not valid in shader model ps_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixSetElement +; CHECK-NEXT: Function: mainPS: error: Opcode LinAlgMatrixStoreToMemory not valid in shader model ps_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixStoreToMemory +; CHECK-NEXT: Function: mainPS: error: Opcode LinAlgMatrixAccumulateToMemory not valid in shader model ps_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixAccumulateToMemory +; CHECK-NEXT: Function: mainPS: error: Opcode LinAlgMatrixLoadFromMemory not valid in shader model ps_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromMemory +; CHECK-NEXT: Function: mainPS: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details. +; CHECK-NEXT: Function: mainPS: error: Function uses features incompatible with the shader stage (ps) of the entry function. +; CHECK-NEXT: Function: mainPS: error: Function requires a visible group, but is called from a shader without one. +; CHECK-NEXT: Validation failed. target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64" target triple = "dxil-ms-dx" @@ -40,14 +54,17 @@ define void @mainPS() { ; Built-ins allowed in all stages ; + %mC4M5N4U0S2 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + %mC4M4N5U1S2 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + ; dx.op.linAlgMatrixAccumulate - %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.LinAlgMatrixC4M4N5U1S2 undef) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) + %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.LinAlgMatrixC4M4N5U1S2 %mC4M4N5U1S2) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) ; dx.op.linAlgMatrixAccumulateToDescriptor - call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) + call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) ; dx.op.linAlgMatrixLength - %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 undef) ; LinAlgMatrixLength(matrix) + %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2) ; LinAlgMatrixLength(matrix) ; dx.op.linAlgMatrixLoadFromDescriptor %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 5, i32 5, i32 5, i32 4) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) @@ -133,6 +150,9 @@ declare i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32, %dx.types.LinAlgMatrixC4M ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32, <4 x i32>, <4 x i32>) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-raytracing.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-raytracing.ll index b687b5945e..784ca6d322 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-raytracing.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-raytracing.ll @@ -1,116 +1,201 @@ ; REQUIRES: dxil-1-10 ; RUN: not %dxv %s 2>&1 | FileCheck %s -; CHECK: Function: {{.*}}MainMS{{.*}}: error: Opcode LinAlgMatrixMultiply not valid in shader model lib_6_10(miss). -; CHECK: Function: {{.*}}MainCH{{.*}}: error: Opcode LinAlgMatrixMultiply not valid in shader model lib_6_10(closesthit). -; CHECK: Function: {{.*}}MainAH{{.*}}: error: Opcode LinAlgMatrixMultiply not valid in shader model lib_6_10(anyhit). -; CHECK: Function: {{.*}}MainCL{{.*}}: error: Opcode LinAlgMatrixMultiply not valid in shader model lib_6_10(callable). -; CHECK: Function: {{.*}}MainIS{{.*}}: error: Opcode LinAlgMatrixMultiply not valid in shader model lib_6_10(intersection). -; CHECK: Function: {{.*}}MainRG{{.*}}: error: Opcode LinAlgMatrixMultiply not valid in shader model lib_6_10(raygeneration). - -; CHECK: Function: {{.*}}MainMS{{.*}}: error: Opcode LinAlgMatrixAccumulate not valid in shader model lib_6_10(miss). -; CHECK: Function: {{.*}}MainCH{{.*}}: error: Opcode LinAlgMatrixAccumulate not valid in shader model lib_6_10(closesthit). -; CHECK: Function: {{.*}}MainAH{{.*}}: error: Opcode LinAlgMatrixAccumulate not valid in shader model lib_6_10(anyhit). -; CHECK: Function: {{.*}}MainCL{{.*}}: error: Opcode LinAlgMatrixAccumulate not valid in shader model lib_6_10(callable). -; CHECK: Function: {{.*}}MainIS{{.*}}: error: Opcode LinAlgMatrixAccumulate not valid in shader model lib_6_10(intersection). -; CHECK: Function: {{.*}}MainRG{{.*}}: error: Opcode LinAlgMatrixAccumulate not valid in shader model lib_6_10(raygeneration). - -; CHECK: Function: {{.*}}MainMS{{.*}}: error: Opcode LinAlgMatrixStoreToDescriptor not valid in shader model lib_6_10(miss). -; CHECK: Function: {{.*}}MainCH{{.*}}: error: Opcode LinAlgMatrixStoreToDescriptor not valid in shader model lib_6_10(closesthit). -; CHECK: Function: {{.*}}MainAH{{.*}}: error: Opcode LinAlgMatrixStoreToDescriptor not valid in shader model lib_6_10(anyhit). -; CHECK: Function: {{.*}}MainCL{{.*}}: error: Opcode LinAlgMatrixStoreToDescriptor not valid in shader model lib_6_10(callable). -; CHECK: Function: {{.*}}MainIS{{.*}}: error: Opcode LinAlgMatrixStoreToDescriptor not valid in shader model lib_6_10(intersection). -; CHECK: Function: {{.*}}MainRG{{.*}}: error: Opcode LinAlgMatrixStoreToDescriptor not valid in shader model lib_6_10(raygeneration). - -; CHECK: Function: {{.*}}MainMS{{.*}}: error: Opcode LinAlgMatrixLength not valid in shader model lib_6_10(miss). -; CHECK: Function: {{.*}}MainCH{{.*}}: error: Opcode LinAlgMatrixLength not valid in shader model lib_6_10(closesthit). -; CHECK: Function: {{.*}}MainAH{{.*}}: error: Opcode LinAlgMatrixLength not valid in shader model lib_6_10(anyhit). -; CHECK: Function: {{.*}}MainCL{{.*}}: error: Opcode LinAlgMatrixLength not valid in shader model lib_6_10(callable). -; CHECK: Function: {{.*}}MainIS{{.*}}: error: Opcode LinAlgMatrixLength not valid in shader model lib_6_10(intersection). -; CHECK: Function: {{.*}}MainRG{{.*}}: error: Opcode LinAlgMatrixLength not valid in shader model lib_6_10(raygeneration). - -; CHECK: Function: {{.*}}MainMS{{.*}}: error: Opcode LinAlgCopyConvertMatrix not valid in shader model lib_6_10(miss). -; CHECK: Function: {{.*}}MainCH{{.*}}: error: Opcode LinAlgCopyConvertMatrix not valid in shader model lib_6_10(closesthit). -; CHECK: Function: {{.*}}MainAH{{.*}}: error: Opcode LinAlgCopyConvertMatrix not valid in shader model lib_6_10(anyhit). -; CHECK: Function: {{.*}}MainCL{{.*}}: error: Opcode LinAlgCopyConvertMatrix not valid in shader model lib_6_10(callable). -; CHECK: Function: {{.*}}MainIS{{.*}}: error: Opcode LinAlgCopyConvertMatrix not valid in shader model lib_6_10(intersection). -; CHECK: Function: {{.*}}MainRG{{.*}}: error: Opcode LinAlgCopyConvertMatrix not valid in shader model lib_6_10(raygeneration). - -; CHECK: Function: {{.*}}MainMS{{.*}}: error: Opcode LinAlgFillMatrix not valid in shader model lib_6_10(miss). -; CHECK: Function: {{.*}}MainCH{{.*}}: error: Opcode LinAlgFillMatrix not valid in shader model lib_6_10(closesthit). -; CHECK: Function: {{.*}}MainAH{{.*}}: error: Opcode LinAlgFillMatrix not valid in shader model lib_6_10(anyhit). -; CHECK: Function: {{.*}}MainCL{{.*}}: error: Opcode LinAlgFillMatrix not valid in shader model lib_6_10(callable). -; CHECK: Function: {{.*}}MainIS{{.*}}: error: Opcode LinAlgFillMatrix not valid in shader model lib_6_10(intersection). -; CHECK: Function: {{.*}}MainRG{{.*}}: error: Opcode LinAlgFillMatrix not valid in shader model lib_6_10(raygeneration). - -; CHECK: Function: {{.*}}MainMS{{.*}}: error: Opcode LinAlgMatrixGetCoordinate not valid in shader model lib_6_10(miss). -; CHECK: Function: {{.*}}MainCH{{.*}}: error: Opcode LinAlgMatrixGetCoordinate not valid in shader model lib_6_10(closesthit). -; CHECK: Function: {{.*}}MainAH{{.*}}: error: Opcode LinAlgMatrixGetCoordinate not valid in shader model lib_6_10(anyhit). -; CHECK: Function: {{.*}}MainCL{{.*}}: error: Opcode LinAlgMatrixGetCoordinate not valid in shader model lib_6_10(callable). -; CHECK: Function: {{.*}}MainIS{{.*}}: error: Opcode LinAlgMatrixGetCoordinate not valid in shader model lib_6_10(intersection). -; CHECK: Function: {{.*}}MainRG{{.*}}: error: Opcode LinAlgMatrixGetCoordinate not valid in shader model lib_6_10(raygeneration). - -; CHECK: Function: {{.*}}MainMS{{.*}}: error: Opcode LinAlgMatrixGetElement not valid in shader model lib_6_10(miss). -; CHECK: Function: {{.*}}MainCH{{.*}}: error: Opcode LinAlgMatrixGetElement not valid in shader model lib_6_10(closesthit). -; CHECK: Function: {{.*}}MainAH{{.*}}: error: Opcode LinAlgMatrixGetElement not valid in shader model lib_6_10(anyhit). -; CHECK: Function: {{.*}}MainCL{{.*}}: error: Opcode LinAlgMatrixGetElement not valid in shader model lib_6_10(callable). -; CHECK: Function: {{.*}}MainIS{{.*}}: error: Opcode LinAlgMatrixGetElement not valid in shader model lib_6_10(intersection). -; CHECK: Function: {{.*}}MainRG{{.*}}: error: Opcode LinAlgMatrixGetElement not valid in shader model lib_6_10(raygeneration). - -; CHECK: Function: {{.*}}MainMS{{.*}}: error: Opcode LinAlgMatrixMultiplyAccumulate not valid in shader model lib_6_10(miss). -; CHECK: Function: {{.*}}MainCH{{.*}}: error: Opcode LinAlgMatrixMultiplyAccumulate not valid in shader model lib_6_10(closesthit). -; CHECK: Function: {{.*}}MainAH{{.*}}: error: Opcode LinAlgMatrixMultiplyAccumulate not valid in shader model lib_6_10(anyhit). -; CHECK: Function: {{.*}}MainCL{{.*}}: error: Opcode LinAlgMatrixMultiplyAccumulate not valid in shader model lib_6_10(callable). -; CHECK: Function: {{.*}}MainIS{{.*}}: error: Opcode LinAlgMatrixMultiplyAccumulate not valid in shader model lib_6_10(intersection). -; CHECK: Function: {{.*}}MainRG{{.*}}: error: Opcode LinAlgMatrixMultiplyAccumulate not valid in shader model lib_6_10(raygeneration). - -; CHECK: Function: {{.*}}MainMS{{.*}}: error: Opcode LinAlgMatrixSetElement not valid in shader model lib_6_10(miss). -; CHECK: Function: {{.*}}MainCH{{.*}}: error: Opcode LinAlgMatrixSetElement not valid in shader model lib_6_10(closesthit). -; CHECK: Function: {{.*}}MainAH{{.*}}: error: Opcode LinAlgMatrixSetElement not valid in shader model lib_6_10(anyhit). -; CHECK: Function: {{.*}}MainCL{{.*}}: error: Opcode LinAlgMatrixSetElement not valid in shader model lib_6_10(callable). -; CHECK: Function: {{.*}}MainIS{{.*}}: error: Opcode LinAlgMatrixSetElement not valid in shader model lib_6_10(intersection). -; CHECK: Function: {{.*}}MainRG{{.*}}: error: Opcode LinAlgMatrixSetElement not valid in shader model lib_6_10(raygeneration). - -; CHECK: Function: {{.*}}MainMS{{.*}}: error: Opcode LinAlgMatrixStoreToMemory not valid in shader model lib_6_10(miss). -; CHECK: Function: {{.*}}MainCH{{.*}}: error: Opcode LinAlgMatrixStoreToMemory not valid in shader model lib_6_10(closesthit). -; CHECK: Function: {{.*}}MainAH{{.*}}: error: Opcode LinAlgMatrixStoreToMemory not valid in shader model lib_6_10(anyhit). -; CHECK: Function: {{.*}}MainCL{{.*}}: error: Opcode LinAlgMatrixStoreToMemory not valid in shader model lib_6_10(callable). -; CHECK: Function: {{.*}}MainIS{{.*}}: error: Opcode LinAlgMatrixStoreToMemory not valid in shader model lib_6_10(intersection). -; CHECK: Function: {{.*}}MainRG{{.*}}: error: Opcode LinAlgMatrixStoreToMemory not valid in shader model lib_6_10(raygeneration). - -; CHECK: Function: {{.*}}MainMS{{.*}}: error: Opcode LinAlgMatrixAccumulateToMemory not valid in shader model lib_6_10(miss). -; CHECK: Function: {{.*}}MainCH{{.*}}: error: Opcode LinAlgMatrixAccumulateToMemory not valid in shader model lib_6_10(closesthit). -; CHECK: Function: {{.*}}MainAH{{.*}}: error: Opcode LinAlgMatrixAccumulateToMemory not valid in shader model lib_6_10(anyhit). -; CHECK: Function: {{.*}}MainCL{{.*}}: error: Opcode LinAlgMatrixAccumulateToMemory not valid in shader model lib_6_10(callable). -; CHECK: Function: {{.*}}MainIS{{.*}}: error: Opcode LinAlgMatrixAccumulateToMemory not valid in shader model lib_6_10(intersection). -; CHECK: Function: {{.*}}MainRG{{.*}}: error: Opcode LinAlgMatrixAccumulateToMemory not valid in shader model lib_6_10(raygeneration). - -; CHECK: Function: {{.*}}MainMS{{.*}}: error: Opcode LinAlgMatrixLoadFromMemory not valid in shader model lib_6_10(miss). -; CHECK: Function: {{.*}}MainCH{{.*}}: error: Opcode LinAlgMatrixLoadFromMemory not valid in shader model lib_6_10(closesthit). -; CHECK: Function: {{.*}}MainAH{{.*}}: error: Opcode LinAlgMatrixLoadFromMemory not valid in shader model lib_6_10(anyhit). -; CHECK: Function: {{.*}}MainCL{{.*}}: error: Opcode LinAlgMatrixLoadFromMemory not valid in shader model lib_6_10(callable). -; CHECK: Function: {{.*}}MainIS{{.*}}: error: Opcode LinAlgMatrixLoadFromMemory not valid in shader model lib_6_10(intersection). -; CHECK: Function: {{.*}}MainRG{{.*}}: error: Opcode LinAlgMatrixLoadFromMemory not valid in shader model lib_6_10(raygeneration). - -; CHECK: Function: {{.*}}MainRG{{.*}}: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details. -; CHECK: Function: {{.*}}MainRG{{.*}}: error: Function uses features incompatible with the shader stage (raygeneration) of the entry function. - -; CHECK: Function: {{.*}}MainIS{{.*}}: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details. -; CHECK: Function: {{.*}}MainIS{{.*}}: error: Function uses features incompatible with the shader stage (intersection) of the entry function. - -; CHECK: Function: {{.*}}MainCL{{.*}}: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details. -; CHECK: Function: {{.*}}MainCL{{.*}}: error: Function uses features incompatible with the shader stage (callable) of the entry function. - -; CHECK: Function: {{.*}}MainAH{{.*}}: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details. -; CHECK: Function: {{.*}}MainAH{{.*}}: error: Function uses features incompatible with the shader stage (anyhit) of the entry function. - -; CHECK: Function: {{.*}}MainCH{{.*}}: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details. -; CHECK: Function: {{.*}}MainCH{{.*}}: error: Function uses features incompatible with the shader stage (closesthit) of the entry function. - -; CHECK: Function: {{.*}}MainMS{{.*}}: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details. -; CHECK: Function: {{.*}}MainMS{{.*}}: error: Function uses features incompatible with the shader stage (miss) of the entry function. - -; CHECK: Validation failed. +; CHECK: Function: {{.*}}MainMS{{.*}}: error: Opcode LinAlgMatrixMultiply not valid in shader model lib_6_10(miss). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixMultiply +; CHECK-NEXT: Function: {{.*}}MainCH{{.*}}: error: Opcode LinAlgMatrixMultiply not valid in shader model lib_6_10(closesthit). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixMultiply +; CHECK-NEXT: Function: {{.*}}MainAH{{.*}}: error: Opcode LinAlgMatrixMultiply not valid in shader model lib_6_10(anyhit). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixMultiply +; CHECK-NEXT: Function: {{.*}}MainCL{{.*}}: error: Opcode LinAlgMatrixMultiply not valid in shader model lib_6_10(callable). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixMultiply +; CHECK-NEXT: Function: {{.*}}MainIS{{.*}}: error: Opcode LinAlgMatrixMultiply not valid in shader model lib_6_10(intersection). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixMultiply +; CHECK-NEXT: Function: {{.*}}MainRG{{.*}}: error: Opcode LinAlgMatrixMultiply not valid in shader model lib_6_10(raygeneration). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixMultiply + +; CHECK-NEXT: Function: {{.*}}MainMS{{.*}}: error: Opcode LinAlgMatrixAccumulate not valid in shader model lib_6_10(miss). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixAccumulate +; CHECK-NEXT: Function: {{.*}}MainCH{{.*}}: error: Opcode LinAlgMatrixAccumulate not valid in shader model lib_6_10(closesthit). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixAccumulate +; CHECK-NEXT: Function: {{.*}}MainAH{{.*}}: error: Opcode LinAlgMatrixAccumulate not valid in shader model lib_6_10(anyhit). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixAccumulate +; CHECK-NEXT: Function: {{.*}}MainCL{{.*}}: error: Opcode LinAlgMatrixAccumulate not valid in shader model lib_6_10(callable). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixAccumulate +; CHECK-NEXT: Function: {{.*}}MainIS{{.*}}: error: Opcode LinAlgMatrixAccumulate not valid in shader model lib_6_10(intersection). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixAccumulate +; CHECK-NEXT: Function: {{.*}}MainRG{{.*}}: error: Opcode LinAlgMatrixAccumulate not valid in shader model lib_6_10(raygeneration). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixAccumulate + +; CHECK-NEXT: Function: {{.*}}MainMS{{.*}}: error: Opcode LinAlgMatrixStoreToDescriptor not valid in shader model lib_6_10(miss). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixStoreToDescriptor +; CHECK-NEXT: Function: {{.*}}MainCH{{.*}}: error: Opcode LinAlgMatrixStoreToDescriptor not valid in shader model lib_6_10(closesthit). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixStoreToDescriptor +; CHECK-NEXT: Function: {{.*}}MainAH{{.*}}: error: Opcode LinAlgMatrixStoreToDescriptor not valid in shader model lib_6_10(anyhit). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixStoreToDescriptor +; CHECK-NEXT: Function: {{.*}}MainCL{{.*}}: error: Opcode LinAlgMatrixStoreToDescriptor not valid in shader model lib_6_10(callable). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixStoreToDescriptor +; CHECK-NEXT: Function: {{.*}}MainIS{{.*}}: error: Opcode LinAlgMatrixStoreToDescriptor not valid in shader model lib_6_10(intersection). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixStoreToDescriptor +; CHECK-NEXT: Function: {{.*}}MainRG{{.*}}: error: Opcode LinAlgMatrixStoreToDescriptor not valid in shader model lib_6_10(raygeneration). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixStoreToDescriptor + +; CHECK-NEXT: Function: {{.*}}MainMS{{.*}}: error: Opcode LinAlgMatrixLength not valid in shader model lib_6_10(miss). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLength +; CHECK-NEXT: Function: {{.*}}MainCH{{.*}}: error: Opcode LinAlgMatrixLength not valid in shader model lib_6_10(closesthit). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLength +; CHECK-NEXT: Function: {{.*}}MainAH{{.*}}: error: Opcode LinAlgMatrixLength not valid in shader model lib_6_10(anyhit). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLength +; CHECK-NEXT: Function: {{.*}}MainCL{{.*}}: error: Opcode LinAlgMatrixLength not valid in shader model lib_6_10(callable). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLength +; CHECK-NEXT: Function: {{.*}}MainIS{{.*}}: error: Opcode LinAlgMatrixLength not valid in shader model lib_6_10(intersection). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLength +; CHECK-NEXT: Function: {{.*}}MainRG{{.*}}: error: Opcode LinAlgMatrixLength not valid in shader model lib_6_10(raygeneration). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLength + +; CHECK-NEXT: Function: {{.*}}MainMS{{.*}}: error: Opcode LinAlgCopyConvertMatrix not valid in shader model lib_6_10(miss). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgCopyConvertMatrix +; CHECK-NEXT: Function: {{.*}}MainCH{{.*}}: error: Opcode LinAlgCopyConvertMatrix not valid in shader model lib_6_10(closesthit). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgCopyConvertMatrix +; CHECK-NEXT: Function: {{.*}}MainAH{{.*}}: error: Opcode LinAlgCopyConvertMatrix not valid in shader model lib_6_10(anyhit). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgCopyConvertMatrix +; CHECK-NEXT: Function: {{.*}}MainCL{{.*}}: error: Opcode LinAlgCopyConvertMatrix not valid in shader model lib_6_10(callable). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgCopyConvertMatrix +; CHECK-NEXT: Function: {{.*}}MainIS{{.*}}: error: Opcode LinAlgCopyConvertMatrix not valid in shader model lib_6_10(intersection). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgCopyConvertMatrix +; CHECK-NEXT: Function: {{.*}}MainRG{{.*}}: error: Opcode LinAlgCopyConvertMatrix not valid in shader model lib_6_10(raygeneration). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgCopyConvertMatrix + +; CHECK-NEXT: Function: {{.*}}MainMS{{.*}}: error: Opcode LinAlgFillMatrix not valid in shader model lib_6_10(miss). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgFillMatrix +; CHECK-NEXT: Function: {{.*}}MainCH{{.*}}: error: Opcode LinAlgFillMatrix not valid in shader model lib_6_10(closesthit). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgFillMatrix +; CHECK-NEXT: Function: {{.*}}MainAH{{.*}}: error: Opcode LinAlgFillMatrix not valid in shader model lib_6_10(anyhit). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgFillMatrix +; CHECK-NEXT: Function: {{.*}}MainCL{{.*}}: error: Opcode LinAlgFillMatrix not valid in shader model lib_6_10(callable). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgFillMatrix +; CHECK-NEXT: Function: {{.*}}MainIS{{.*}}: error: Opcode LinAlgFillMatrix not valid in shader model lib_6_10(intersection). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgFillMatrix +; CHECK-NEXT: Function: {{.*}}MainRG{{.*}}: error: Opcode LinAlgFillMatrix not valid in shader model lib_6_10(raygeneration). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgFillMatrix + +; CHECK-NEXT: Function: {{.*}}MainMS{{.*}}: error: Opcode LinAlgMatrixGetCoordinate not valid in shader model lib_6_10(miss). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixGetCoordinate +; CHECK-NEXT: Function: {{.*}}MainCH{{.*}}: error: Opcode LinAlgMatrixGetCoordinate not valid in shader model lib_6_10(closesthit). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixGetCoordinate +; CHECK-NEXT: Function: {{.*}}MainAH{{.*}}: error: Opcode LinAlgMatrixGetCoordinate not valid in shader model lib_6_10(anyhit). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixGetCoordinate +; CHECK-NEXT: Function: {{.*}}MainCL{{.*}}: error: Opcode LinAlgMatrixGetCoordinate not valid in shader model lib_6_10(callable). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixGetCoordinate +; CHECK-NEXT: Function: {{.*}}MainIS{{.*}}: error: Opcode LinAlgMatrixGetCoordinate not valid in shader model lib_6_10(intersection). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixGetCoordinate +; CHECK-NEXT: Function: {{.*}}MainRG{{.*}}: error: Opcode LinAlgMatrixGetCoordinate not valid in shader model lib_6_10(raygeneration). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixGetCoordinate + +; CHECK-NEXT: Function: {{.*}}MainMS{{.*}}: error: Opcode LinAlgMatrixGetElement not valid in shader model lib_6_10(miss). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixGetElement +; CHECK-NEXT: Function: {{.*}}MainCH{{.*}}: error: Opcode LinAlgMatrixGetElement not valid in shader model lib_6_10(closesthit). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixGetElement +; CHECK-NEXT: Function: {{.*}}MainAH{{.*}}: error: Opcode LinAlgMatrixGetElement not valid in shader model lib_6_10(anyhit). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixGetElement +; CHECK-NEXT: Function: {{.*}}MainCL{{.*}}: error: Opcode LinAlgMatrixGetElement not valid in shader model lib_6_10(callable). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixGetElement +; CHECK-NEXT: Function: {{.*}}MainIS{{.*}}: error: Opcode LinAlgMatrixGetElement not valid in shader model lib_6_10(intersection). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixGetElement +; CHECK-NEXT: Function: {{.*}}MainRG{{.*}}: error: Opcode LinAlgMatrixGetElement not valid in shader model lib_6_10(raygeneration). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixGetElement + +; CHECK-NEXT: Function: {{.*}}MainMS{{.*}}: error: Opcode LinAlgMatrixMultiplyAccumulate not valid in shader model lib_6_10(miss). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixMultiplyAccumulate +; CHECK-NEXT: Function: {{.*}}MainCH{{.*}}: error: Opcode LinAlgMatrixMultiplyAccumulate not valid in shader model lib_6_10(closesthit). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixMultiplyAccumulate +; CHECK-NEXT: Function: {{.*}}MainAH{{.*}}: error: Opcode LinAlgMatrixMultiplyAccumulate not valid in shader model lib_6_10(anyhit). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixMultiplyAccumulate +; CHECK-NEXT: Function: {{.*}}MainCL{{.*}}: error: Opcode LinAlgMatrixMultiplyAccumulate not valid in shader model lib_6_10(callable). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixMultiplyAccumulate +; CHECK-NEXT: Function: {{.*}}MainIS{{.*}}: error: Opcode LinAlgMatrixMultiplyAccumulate not valid in shader model lib_6_10(intersection). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixMultiplyAccumulate +; CHECK-NEXT: Function: {{.*}}MainRG{{.*}}: error: Opcode LinAlgMatrixMultiplyAccumulate not valid in shader model lib_6_10(raygeneration). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixMultiplyAccumulate + +; CHECK-NEXT: Function: {{.*}}MainMS{{.*}}: error: Opcode LinAlgMatrixSetElement not valid in shader model lib_6_10(miss). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixSetElement +; CHECK-NEXT: Function: {{.*}}MainCH{{.*}}: error: Opcode LinAlgMatrixSetElement not valid in shader model lib_6_10(closesthit). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixSetElement +; CHECK-NEXT: Function: {{.*}}MainAH{{.*}}: error: Opcode LinAlgMatrixSetElement not valid in shader model lib_6_10(anyhit). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixSetElement +; CHECK-NEXT: Function: {{.*}}MainCL{{.*}}: error: Opcode LinAlgMatrixSetElement not valid in shader model lib_6_10(callable). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixSetElement +; CHECK-NEXT: Function: {{.*}}MainIS{{.*}}: error: Opcode LinAlgMatrixSetElement not valid in shader model lib_6_10(intersection). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixSetElement +; CHECK-NEXT: Function: {{.*}}MainRG{{.*}}: error: Opcode LinAlgMatrixSetElement not valid in shader model lib_6_10(raygeneration). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixSetElement + +; CHECK-NEXT: Function: {{.*}}MainMS{{.*}}: error: Opcode LinAlgMatrixStoreToMemory not valid in shader model lib_6_10(miss). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixStoreToMemory +; CHECK-NEXT: Function: {{.*}}MainCH{{.*}}: error: Opcode LinAlgMatrixStoreToMemory not valid in shader model lib_6_10(closesthit). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixStoreToMemory +; CHECK-NEXT: Function: {{.*}}MainAH{{.*}}: error: Opcode LinAlgMatrixStoreToMemory not valid in shader model lib_6_10(anyhit). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixStoreToMemory +; CHECK-NEXT: Function: {{.*}}MainCL{{.*}}: error: Opcode LinAlgMatrixStoreToMemory not valid in shader model lib_6_10(callable). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixStoreToMemory +; CHECK-NEXT: Function: {{.*}}MainIS{{.*}}: error: Opcode LinAlgMatrixStoreToMemory not valid in shader model lib_6_10(intersection). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixStoreToMemory +; CHECK-NEXT: Function: {{.*}}MainRG{{.*}}: error: Opcode LinAlgMatrixStoreToMemory not valid in shader model lib_6_10(raygeneration). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixStoreToMemory + +; CHECK-NEXT: Function: {{.*}}MainMS{{.*}}: error: Opcode LinAlgMatrixAccumulateToMemory not valid in shader model lib_6_10(miss). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixAccumulateToMemory +; CHECK-NEXT: Function: {{.*}}MainCH{{.*}}: error: Opcode LinAlgMatrixAccumulateToMemory not valid in shader model lib_6_10(closesthit). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixAccumulateToMemory +; CHECK-NEXT: Function: {{.*}}MainAH{{.*}}: error: Opcode LinAlgMatrixAccumulateToMemory not valid in shader model lib_6_10(anyhit). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixAccumulateToMemory +; CHECK-NEXT: Function: {{.*}}MainCL{{.*}}: error: Opcode LinAlgMatrixAccumulateToMemory not valid in shader model lib_6_10(callable). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixAccumulateToMemory +; CHECK-NEXT: Function: {{.*}}MainIS{{.*}}: error: Opcode LinAlgMatrixAccumulateToMemory not valid in shader model lib_6_10(intersection). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixAccumulateToMemory +; CHECK-NEXT: Function: {{.*}}MainRG{{.*}}: error: Opcode LinAlgMatrixAccumulateToMemory not valid in shader model lib_6_10(raygeneration). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixAccumulateToMemory + +; CHECK-NEXT: Function: {{.*}}MainMS{{.*}}: error: Opcode LinAlgMatrixLoadFromMemory not valid in shader model lib_6_10(miss). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromMemory +; CHECK-NEXT: Function: {{.*}}MainCH{{.*}}: error: Opcode LinAlgMatrixLoadFromMemory not valid in shader model lib_6_10(closesthit). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromMemory +; CHECK-NEXT: Function: {{.*}}MainAH{{.*}}: error: Opcode LinAlgMatrixLoadFromMemory not valid in shader model lib_6_10(anyhit). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromMemory +; CHECK-NEXT: Function: {{.*}}MainCL{{.*}}: error: Opcode LinAlgMatrixLoadFromMemory not valid in shader model lib_6_10(callable). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromMemory +; CHECK-NEXT: Function: {{.*}}MainIS{{.*}}: error: Opcode LinAlgMatrixLoadFromMemory not valid in shader model lib_6_10(intersection). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromMemory +; CHECK-NEXT: Function: {{.*}}MainRG{{.*}}: error: Opcode LinAlgMatrixLoadFromMemory not valid in shader model lib_6_10(raygeneration). +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromMemory + + +; CHECK-NEXT: Function: {{.*}}MainRG{{.*}}: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details. +; CHECK-NEXT: Function: {{.*}}MainRG{{.*}}: error: Function uses features incompatible with the shader stage (raygeneration) of the entry function. +; CHECK-NEXT: Function: {{.*}}MainRG{{.*}}: error: Function requires a visible group, but is called from a shader without one. + +; CHECK-NEXT: Function: {{.*}}MainIS{{.*}}: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details. +; CHECK-NEXT: Function: {{.*}}MainIS{{.*}}: error: Function uses features incompatible with the shader stage (intersection) of the entry function. +; CHECK-NEXT: Function: {{.*}}MainIS{{.*}}: error: Function requires a visible group, but is called from a shader without one. + +; CHECK-NEXT: Function: {{.*}}MainCL{{.*}}: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details. +; CHECK-NEXT: Function: {{.*}}MainCL{{.*}}: error: Function uses features incompatible with the shader stage (callable) of the entry function. +; CHECK-NEXT: Function: {{.*}}MainCL{{.*}}: error: Function requires a visible group, but is called from a shader without one. + +; CHECK-NEXT: Function: {{.*}}MainAH{{.*}}: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details. +; CHECK-NEXT: Function: {{.*}}MainAH{{.*}}: error: Function uses features incompatible with the shader stage (anyhit) of the entry function. +; CHECK-NEXT: Function: {{.*}}MainAH{{.*}}: error: Function requires a visible group, but is called from a shader without one. + +; CHECK-NEXT: Function: {{.*}}MainCH{{.*}}: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details. +; CHECK-NEXT: Function: {{.*}}MainCH{{.*}}: error: Function uses features incompatible with the shader stage (closesthit) of the entry function. +; CHECK-NEXT: Function: {{.*}}MainCH{{.*}}: error: Function requires a visible group, but is called from a shader without one. + +; CHECK-NEXT: Function: {{.*}}MainMS{{.*}}: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details. +; CHECK-NEXT: Function: {{.*}}MainMS{{.*}}: error: Function uses features incompatible with the shader stage (miss) of the entry function. +; CHECK-NEXT: Function: {{.*}}MainMS{{.*}}: error: Function requires a visible group, but is called from a shader without one. + +; CHECK-NEXT: Validation failed. target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64" target triple = "dxil-ms-dx" @@ -134,9 +219,12 @@ define void @"\01?MainRG@@YAXXZ"() #0 { ; ; Built-ins allowed in all stages ; - %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.LinAlgMatrixC4M4N5U1S2 undef) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) - call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout) - %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 undef) ; LinAlgMatrixLength(matrix) + %mC4M5N4U0S2 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + %mC4M4N5U1S2 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + + %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.LinAlgMatrixC4M4N5U1S2 %mC4M4N5U1S2) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) + call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout) + %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2) ; LinAlgMatrixLength(matrix) %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 5, i32 5, i32 5, i32 4) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout) %v4 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483619, <4 x i32> , <4 x i32> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) %v5 = call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() @@ -171,9 +259,12 @@ define void @"\01?MainIS@@YAXXZ"() #0 { ; ; Built-ins allowed in all stages ; - %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.LinAlgMatrixC4M4N5U1S2 undef) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) - call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout) - %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 undef) ; LinAlgMatrixLength(matrix) + %mC4M5N4U0S2 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + %mC4M4N5U1S2 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + + %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.LinAlgMatrixC4M4N5U1S2 %mC4M4N5U1S2) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) + call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout) + %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2) ; LinAlgMatrixLength(matrix) %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 5, i32 5, i32 5, i32 4) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout) %v4 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483619, <4 x i32> , <4 x i32> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) %v5 = call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() @@ -208,9 +299,12 @@ define void @"\01?MainCL@@YAXUAttribs@@@Z"(%struct.Attribs* noalias nocapture %a ; ; Built-ins allowed in all stages ; - %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.LinAlgMatrixC4M4N5U1S2 undef) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) - call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout) - %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 undef) ; LinAlgMatrixLength(matrix) + %mC4M5N4U0S2 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + %mC4M4N5U1S2 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + + %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.LinAlgMatrixC4M4N5U1S2 %mC4M4N5U1S2) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) + call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout) + %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2) ; LinAlgMatrixLength(matrix) %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 5, i32 5, i32 5, i32 4) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout) %v4 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483619, <4 x i32> , <4 x i32> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) %v5 = call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() @@ -245,9 +339,12 @@ define void @"\01?MainAH@@YAXURayPayload@@UAttribs@@@Z"(%struct.RayPayload* noal ; ; Built-ins allowed in all stages ; - %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.LinAlgMatrixC4M4N5U1S2 undef) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) - call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout) - %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 undef) ; LinAlgMatrixLength(matrix) + %mC4M5N4U0S2 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + %mC4M4N5U1S2 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + + %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.LinAlgMatrixC4M4N5U1S2 %mC4M4N5U1S2) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) + call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout) + %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2) ; LinAlgMatrixLength(matrix) %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 5, i32 5, i32 5, i32 4) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout) %v4 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483619, <4 x i32> , <4 x i32> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) %v5 = call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() @@ -282,9 +379,12 @@ define void @"\01?MainCH@@YAXURayPayload@@UAttribs@@@Z"(%struct.RayPayload* noal ; ; Built-ins allowed in all stages ; - %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.LinAlgMatrixC4M4N5U1S2 undef) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) - call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout) - %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 undef) ; LinAlgMatrixLength(matrix) + %mC4M5N4U0S2 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + %mC4M4N5U1S2 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + + %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.LinAlgMatrixC4M4N5U1S2 %mC4M4N5U1S2) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) + call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout) + %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2) ; LinAlgMatrixLength(matrix) %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 5, i32 5, i32 5, i32 4) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout) %v4 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483619, <4 x i32> , <4 x i32> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) %v5 = call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() @@ -319,9 +419,12 @@ define void @"\01?MainMS@@YAXURayPayload@@@Z"(%struct.RayPayload* noalias nocapt ; ; Built-ins allowed in all stages ; - %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.LinAlgMatrixC4M4N5U1S2 undef) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) - call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout) - %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 undef) ; LinAlgMatrixLength(matrix) + %mC4M5N4U0S2 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + %mC4M4N5U1S2 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + + %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.LinAlgMatrixC4M4N5U1S2 %mC4M4N5U1S2) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) + call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout) + %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2) ; LinAlgMatrixLength(matrix) %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 5, i32 5, i32 5, i32 4) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout) %v4 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483619, <4 x i32> , <4 x i32> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) %v5 = call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() @@ -367,6 +470,9 @@ declare i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32, %dx.types.LinAlgMatrixC4M ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32, <4 x i32>, <4 x i32>) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-undef-param.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-undef-param.ll new file mode 100644 index 0000000000..6310a086d6 --- /dev/null +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-undef-param.ll @@ -0,0 +1,62 @@ +; REQUIRES: dxil-1-10 +; RUN: not %dxv %s 2>&1 | FileCheck %s + +target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64" +target triple = "dxil-ms-dx" + +%dx.types.Handle = type { i8* } +%dx.types.ResBind = type { i32, i32, i32, i8 } +%dx.types.LinAlgMatrixC4M16N16U0S2 = type { i8* } +%dx.types.ResourceProperties = type { i32, i32 } +%struct.RWByteAddressBuffer = type { i32 } + +define void @main() { + %1 = call %dx.types.Handle @dx.op.createHandleFromBinding(i32 217, %dx.types.ResBind { i32 0, i32 0, i32 0, i8 1 }, i32 0, i1 false) ; CreateHandleFromBinding(bind,index,nonUniformIndex) + %handle = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 4107, i32 0 }) ; AnnotateHandle(res,props) resource: RWByteAddressBuffer + + ; CHECK: Function: main: error: Instructions should not read uninitialized value. + ; CHECK-NEXT: note: at {{.*}}@dx.op.linAlgMatrixAccumulateToDescriptor + call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M16N16U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M16N16U0S2 undef, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) + + ; CHECK: Function: main: error: Instructions should not read uninitialized value. + ; CHECK-NEXT: note: at {{.*}}@dx.op.linAlgMatrixLength + %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M16N16U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M16N16U0S2 undef) ; LinAlgMatrixLength(matrix) + + ; CHECK-NEXT: Validation failed. + + ret void +} + +; Function Attrs: nounwind readnone +declare %dx.types.Handle @dx.op.annotateHandle(i32, %dx.types.Handle, %dx.types.ResourceProperties) #1 + +; Function Attrs: nounwind readnone +declare %dx.types.Handle @dx.op.createHandleFromBinding(i32, %dx.types.ResBind, i32, i1) #1 + +; Function Attrs: nounwind +declare void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M16N16U0S2(i32, %dx.types.LinAlgMatrixC4M16N16U0S2, %dx.types.Handle, i32, i32, i32, i32) #0 + +; Function Attrs: nounwind +declare i32 @dx.op.linAlgMatrixLength.mC4M16N16U0S2(i32, %dx.types.LinAlgMatrixC4M16N16U0S2) #0 + +attributes #0 = { nounwind } +attributes #1 = { nounwind readnone } + +!dx.targetTypes = !{!0} +!llvm.ident = !{!17} +!dx.version = !{!18} +!dx.valver = !{!18} +!dx.shaderModel = !{!19} +!dx.resources = !{!20} +!dx.entryPoints = !{!23} + +!0 = !{%dx.types.LinAlgMatrixC4M16N16U0S2 undef, i32 4, i32 16, i32 16, i32 0, i32 2} +!17 = !{!"dxc(private) 1.9.0.15241 (main, 1f63535ae)"} +!18 = !{i32 1, i32 10} +!19 = !{!"cs", i32 6, i32 10} +!20 = !{null, !21, null, null} +!21 = !{!22} +!22 = !{i32 0, %struct.RWByteAddressBuffer* undef, !"", i32 0, i32 0, i32 1, i32 11, i1 false, i1 false, i1 false, null} +!23 = !{void ()* @main, !"main", null, !20, !24} +!24 = !{i32 0, i64 8589934608, i32 4, !25} +!25 = !{i32 4, i32 4, i32 4} diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-vs.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-vs.ll index debf658676..13de7bc72d 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-vs.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-vs.ll @@ -1,22 +1,36 @@ ; REQUIRES: dxil-1-10 ; RUN: not %dxv %s 2>&1 | FileCheck %s -; CHECK: Function: mainVS: error: Opcode LinAlgMatrixMultiply not valid in shader model vs_6_10. -; CHECK: Function: mainVS: error: Opcode LinAlgMatrixAccumulate not valid in shader model vs_6_10. -; CHECK: Function: mainVS: error: Opcode LinAlgMatrixStoreToDescriptor not valid in shader model vs_6_10. -; CHECK: Function: mainVS: error: Opcode LinAlgMatrixLength not valid in shader model vs_6_10. -; CHECK: Function: mainVS: error: Opcode LinAlgCopyConvertMatrix not valid in shader model vs_6_10. -; CHECK: Function: mainVS: error: Opcode LinAlgFillMatrix not valid in shader model vs_6_10. -; CHECK: Function: mainVS: error: Opcode LinAlgMatrixGetCoordinate not valid in shader model vs_6_10. -; CHECK: Function: mainVS: error: Opcode LinAlgMatrixGetElement not valid in shader model vs_6_10. -; CHECK: Function: mainVS: error: Opcode LinAlgMatrixMultiplyAccumulate not valid in shader model vs_6_10. -; CHECK: Function: mainVS: error: Opcode LinAlgMatrixSetElement not valid in shader model vs_6_10. -; CHECK: Function: mainVS: error: Opcode LinAlgMatrixStoreToMemory not valid in shader model vs_6_10. -; CHECK: Function: mainVS: error: Opcode LinAlgMatrixAccumulateToMemory not valid in shader model vs_6_10. -; CHECK: Function: mainVS: error: Opcode LinAlgMatrixLoadFromMemory not valid in shader model vs_6_10. -; CHECK: Function: mainVS: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details. -; CHECK: Function: mainVS: error: Function uses features incompatible with the shader stage (vs) of the entry function. -; CHECK: Validation failed. +; CHECK: Function: mainVS: error: Opcode LinAlgMatrixMultiply not valid in shader model vs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixMultiply +; CHECK-NEXT: Function: mainVS: error: Opcode LinAlgMatrixAccumulate not valid in shader model vs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixAccumulate +; CHECK-NEXT: Function: mainVS: error: Opcode LinAlgMatrixStoreToDescriptor not valid in shader model vs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixStoreToDescriptor +; CHECK-NEXT: Function: mainVS: error: Opcode LinAlgMatrixLength not valid in shader model vs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLength +; CHECK-NEXT: Function: mainVS: error: Opcode LinAlgCopyConvertMatrix not valid in shader model vs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgCopyConvertMatrix +; CHECK-NEXT: Function: mainVS: error: Opcode LinAlgFillMatrix not valid in shader model vs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgFillMatrix +; CHECK-NEXT: Function: mainVS: error: Opcode LinAlgMatrixGetCoordinate not valid in shader model vs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixGetCoordinate +; CHECK-NEXT: Function: mainVS: error: Opcode LinAlgMatrixGetElement not valid in shader model vs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixGetElement +; CHECK-NEXT: Function: mainVS: error: Opcode LinAlgMatrixMultiplyAccumulate not valid in shader model vs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixMultiplyAccumulate +; CHECK-NEXT: Function: mainVS: error: Opcode LinAlgMatrixSetElement not valid in shader model vs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixSetElement +; CHECK-NEXT: Function: mainVS: error: Opcode LinAlgMatrixStoreToMemory not valid in shader model vs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixStoreToMemory +; CHECK-NEXT: Function: mainVS: error: Opcode LinAlgMatrixAccumulateToMemory not valid in shader model vs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixAccumulateToMemory +; CHECK-NEXT: Function: mainVS: error: Opcode LinAlgMatrixLoadFromMemory not valid in shader model vs_6_10. +; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromMemory +; CHECK-NEXT: Function: mainVS: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details. +; CHECK-NEXT: Function: mainVS: error: Function uses features incompatible with the shader stage (vs) of the entry function. +; CHECK-NEXT: Function: mainVS: error: Function requires a visible group, but is called from a shader without one. +; CHECK-NEXT: Validation failed. target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64" @@ -41,14 +55,17 @@ define void @mainVS() { ; Built-ins allowed in all stages ; + %mC4M5N4U0S2 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + %mC4M4N5U1S2 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + ; dx.op.linAlgMatrixAccumulate - %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.LinAlgMatrixC4M4N5U1S2 undef) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) + %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.LinAlgMatrixC4M4N5U1S2 %mC4M4N5U1S2) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) ; dx.op.linAlgMatrixAccumulateToDescriptor - call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout) + call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout) ; dx.op.linAlgMatrixLength - %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 undef) ; LinAlgMatrixLength(matrix) + %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2) ; LinAlgMatrixLength(matrix) ; dx.op.linAlgMatrixLoadFromDescriptor %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 5, i32 5, i32 5, i32 4) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) @@ -134,6 +151,9 @@ declare i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32, %dx.types.LinAlgMatrixC4M ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32, <4 x i32>, <4 x i32>) #0 diff --git a/utils/hct/hctdb.py b/utils/hct/hctdb.py index ac6eeee55a..d12886c777 100644 --- a/utils/hct/hctdb.py +++ b/utils/hct/hctdb.py @@ -8636,6 +8636,10 @@ def build_valrules(self): "Instr.ReorderCoherentRequiresSM69", "reordercoherent requires SM 6.9 or later.", ) + self.add_valrule( + "Instr.LinAlgIllegalKDim", + "Matrix K Dimension out of bounds. K=%0 must be >= %1 and <= %2.", + ) # Some legacy rules: # - space is only supported for shader targets 5.1 and higher