diff --git a/docs/DXIL.rst b/docs/DXIL.rst index 15bf3af730..cd5c7a5a1b 100644 --- a/docs/DXIL.rst +++ b/docs/DXIL.rst @@ -3213,6 +3213,7 @@ INSTR.LINALGILLEGALCOMPONENTTYPE Matrix Component Type '%0' INSTR.LINALGILLEGALKDIM Matrix K Dimension out of bounds. K=%0 must be >= %1 and <= %2. INSTR.LINALGMATRIXDIMMISMATCH Matrix Dimension '%0x%1' does not match expected dimension %2x%3. INSTR.LINALGMATRIXLAYOUTREQSTRIDE Matrix layout '%0' requires stride 0. +INSTR.LINALGMATRIXLOADTHREADREQUIRESBAB Loading matrix with Thread scope requires ByteAddressBuffer. INSTR.LINALGMATRIXNOTEXACTMATCH Matrix '%0' must exactly match matrix '%1'. INSTR.LINALGMATRIXSCOPEMISMATCH Matrix Scope '%0' does not match expected scope %1. INSTR.LINALGMATRIXSCOPENOTALLOWED Matrix Scope '%0' not allowed in %1 operation. @@ -3246,6 +3247,7 @@ INSTR.OPCODERESERVED Instructions must not refe INSTR.OPCONST DXIL intrinsic requires an immediate constant operand INSTR.OPCONSTRANGE Constant values must be in-range for operation. INSTR.OPERANDRANGE DXIL intrinsic operand must be within defined range +INSTR.PARAMMINIMUMVALUE Parameter must be greater than a minimum value INSTR.PARAMMULTIPLE Parameter must be a valid multiple INSTR.PTRBITCAST Pointer type bitcast must be have same size. INSTR.REORDERCOHERENTREQUIRESSM69 reordercoherent requires SM 6.9 or later. diff --git a/lib/DxilValidation/DxilValidation.cpp b/lib/DxilValidation/DxilValidation.cpp index 747542cdcb..a5ac1ce3d9 100644 --- a/lib/DxilValidation/DxilValidation.cpp +++ b/lib/DxilValidation/DxilValidation.cpp @@ -1144,16 +1144,16 @@ static void ValidateLinAlgMatrixLoadFromDescriptor(CallInst *CI, ValidateLinAlgOpReturnMatrix(CI, ValCtx); ValidateLinAlgOpParameters(CI, ValCtx); + DxilInst_LinAlgMatrixLoadFromDescriptor Op(CI); Type *RetMatTy = CI->getType(); + assert(dxilutil::IsHLSLLinAlgMatrixType(RetMatTy) && "Must be LinAlg type"); auto RetIt = ValCtx.LinAlgTargetTypeMap.find(RetMatTy); if (RetIt == ValCtx.LinAlgTargetTypeMap.end()) return; LinAlgTargetType RetLATT = RetIt->second; - Value *StrideOp = CI->getArgOperand(3); - Value *LayoutOp = CI->getArgOperand(4); - ConstantInt *LayoutCI = dyn_cast(LayoutOp); + ConstantInt *LayoutCI = dyn_cast(Op.get_layout()); if (!LayoutCI) { ValCtx.EmitInstrFormatError(CI, ValidationRule::InstrOpConst, {"Layout", "LinAlgMatrixLoadFromDescriptor"}); @@ -1172,7 +1172,7 @@ static void ValidateLinAlgMatrixLoadFromDescriptor(CallInst *CI, // Stride must be an imm 0 if Layout is not Row/Col Major if (!LayoutIsRowColMajor) { - ConstantInt *StrideCI = dyn_cast(StrideOp); + ConstantInt *StrideCI = dyn_cast(Op.get_stride()); if (StrideCI) { if (!StrideCI->isZero()) ValCtx.EmitInstrFormatError( @@ -1182,6 +1182,32 @@ static void ValidateLinAlgMatrixLoadFromDescriptor(CallInst *CI, ValCtx.EmitInstrFormatError(CI, ValidationRule::InstrOpConst, {"Stride", "LinAlgMatrixLoadFromDescriptor"}); } + + // Align must be an immediate constant that is a multiple of 128 + ConstantInt *AlignCI = dyn_cast(Op.get_align()); + if (AlignCI) { + unsigned Align = AlignCI->getLimitedValue(); + if (Align == 0) + ValCtx.EmitInstrFormatError(CI, ValidationRule::InstrParamMinimumValue, + {"Align", "0", std::to_string(Align)}); + if (Align % 128 != 0) + ValCtx.EmitInstrFormatError(CI, ValidationRule::InstrParamMultiple, + {"Align", "128", std::to_string(Align)}); + } else + ValCtx.EmitInstrFormatError(CI, ValidationRule::InstrOpConst, + {"Align", "LinAlgMatrixLoadFromDescriptor"}); + + // Thread matrix may only load from SRV ByteAddressBuffer + if (RetLATT.Scope == DXIL::MatrixScope::Thread) { + DXIL::ComponentType ResCompTy; + DXIL::ResourceClass ResClass; + DXIL::ResourceKind ResKind = + GetResourceKindAndCompTy(Op.get_handle(), ResCompTy, ResClass, ValCtx); + if (ResClass != DXIL::ResourceClass::SRV || + ResKind != DXIL::ResourceKind::RawBuffer) + ValCtx.EmitInstrError( + CI, ValidationRule::InstrLinAlgMatrixLoadThreadRequiresBAB); + } } static void ValidateLinAlgMatrixAccumulate(CallInst *CI, 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 b584fdeb81..bae8d65283 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixloadfromdescriptor/nominal.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixloadfromdescriptor/nominal.hlsl @@ -9,11 +9,11 @@ void main() { // CHECK-LABEL: define void @main() // CHECK: %{{.*}} = call %dx.types.LinAlgMatrixC2M4N4U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC2M4N4U0S0 - // CHECK-SAME: (i32 -2147483634, %dx.types.Handle %{{.*}}, i32 0, i32 0, i32 0, i32 4) + // CHECK-SAME: (i32 -2147483634, %dx.types.Handle %{{.*}}, i32 0, i32 0, i32 0, i32 128) // CHECK-SAME: ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC2M4N4U0S0*, %dx.types.Handle, i32, i32, i32, i32) - // CHECK2-SAME: "(i32 406, %dx.types.LinAlgMatrixC2M4N4U0S0* %mat, %dx.types.Handle {{.*}}, i32 0, i32 0, i32 0, i32 4) + // CHECK2-SAME: "(i32 406, %dx.types.LinAlgMatrixC2M4N4U0S0* %mat, %dx.types.Handle {{.*}}, i32 0, i32 0, i32 0, i32 128) __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(2, 4, 4, 0, 0)]] mat; - __builtin_LinAlg_MatrixLoadFromDescriptor(mat, inbuf, 0, 0, 0, 4); + __builtin_LinAlg_MatrixLoadFromDescriptor(mat, inbuf, 0, 0, 0, 128); } diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-as.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-as.ll index 9ac79dce9e..e6db969206 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-as.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-as.ll @@ -54,8 +54,8 @@ 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) + %mC4M5N4U0S2 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) + %mC4M4N5U1S2 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) ; dx.op.linAlgMatrixAccumulate %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.LinAlgMatrixC4M4N5U1S2 %mC4M4N5U1S2) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) @@ -67,7 +67,7 @@ define void @mainAS() { %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 0, i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) + %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) ; dx.op.linAlgMatrixOuterProduct %v4 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483619, <4 x i32> , <4 x i32> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-cs.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-cs.ll index 15a08913d4..a63ebfe45b 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-cs.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-cs.ll @@ -26,9 +26,9 @@ 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) - %mC4M4N5U2S2 = call %dx.types.LinAlgMatrixC4M4N5U2S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U2S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + %mC4M5N4U0S2 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) + %mC4M4N5U1S2 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) + %mC4M4N5U2S2 = call %dx.types.LinAlgMatrixC4M4N5U2S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U2S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) ; dx.op.linAlgMatrixAccumulate %v1 = call %dx.types.LinAlgMatrixC4M4N5U2S2 @dx.op.linAlgMatrixAccumulate.mC4M4N5U2S2.mC4M4N5U2S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M4N5U2S2 %mC4M4N5U2S2, %dx.types.LinAlgMatrixC4M4N5U1S2 %mC4M4N5U1S2) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) @@ -40,7 +40,7 @@ define void @mainCS() { %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 0, i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) + %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) ; dx.op.linAlgMatrixOuterProduct %v4 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483619, <4 x i32> , <4 x i32> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ds.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ds.ll index 0331af0fc1..734124d90f 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ds.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ds.ll @@ -55,8 +55,8 @@ 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) + %mC4M5N4U0S2 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) + %mC4M4N5U1S2 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) ; dx.op.linAlgMatrixAccumulate %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.LinAlgMatrixC4M4N5U1S2 %mC4M4N5U1S2) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) @@ -68,7 +68,7 @@ define void @MainDS() { %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 0, i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) + %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) ; dx.op.linAlgMatrixOuterProduct %v4 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483619, <4 x i32> , <4 x i32> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-gs.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-gs.ll index db3301a1fd..37801a2f7d 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-gs.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-gs.ll @@ -55,8 +55,8 @@ 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) + %mC4M5N4U0S2 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) + %mC4M4N5U1S2 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) ; dx.op.linAlgMatrixAccumulate %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.LinAlgMatrixC4M4N5U1S2 %mC4M4N5U1S2) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) @@ -68,7 +68,7 @@ define void @MainGS() { %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 0, i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) + %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) ; dx.op.linAlgMatrixOuterProduct %v4 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483619, <4 x i32> , <4 x i32> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-hs.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-hs.ll index 82e20f7d9e..4c6fe881dc 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-hs.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-hs.ll @@ -54,8 +54,8 @@ 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) + %mC4M5N4U0S2 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) + %mC4M4N5U1S2 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) ; dx.op.linAlgMatrixAccumulate %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.LinAlgMatrixC4M4N5U1S2 %mC4M4N5U1S2) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) @@ -67,7 +67,7 @@ define void @MainHS() { %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 0, i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) + %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) ; dx.op.linAlgMatrixOuterProduct %v4 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483619, <4 x i32> , <4 x i32> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-illegal-component-type.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-illegal-component-type.ll index 89e1510d9d..5bf1e0c951 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-illegal-component-type.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-illegal-component-type.ll @@ -1,23 +1,22 @@ ; 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 datalayout = "e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:16-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.LinAlgMatrixC0M128N128U0S0 = type { i8* } %dx.types.ResourceProperties = type { i32, i32 } -%struct.RWByteAddressBuffer = type { i32 } +%dx.types.LinAlgMatrixC0M16N16U0S0 = type { i8* } +%struct.ByteAddressBuffer = 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 + %1 = call %dx.types.Handle @dx.op.createHandleFromBinding(i32 217, %dx.types.ResBind zeroinitializer, i32 0, i1 false) ; CreateHandleFromBinding(bind,index,nonUniformIndex) + %2 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer ; CHECK: Function: main: error: Matrix Component Type 'Invalid' not allowed in LinAlg Matrix. - ; CHECK-NEXT: note: at '%mC0M128N128U0S0 - ; Matrix - %mC0M128N128U0S0 = call %dx.types.LinAlgMatrixC0M128N128U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC0M128N128U0S0(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromDescriptor.mC0M16N16U0S0 + ; Matrix + %3 = call %dx.types.LinAlgMatrixC0M16N16U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC0M16N16U0S0(i32 -2147483634, %dx.types.Handle %2, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) ; CHECK-NEXT: Validation failed. @@ -25,7 +24,7 @@ define void @main() { } ; Function Attrs: nounwind -declare %dx.types.LinAlgMatrixC0M128N128U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC0M128N128U0S0(i32, %dx.types.Handle, i32, i32, i32, i32) #0 +declare %dx.types.LinAlgMatrixC0M16N16U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC0M16N16U0S0(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 @@ -36,21 +35,21 @@ declare %dx.types.Handle @dx.op.createHandleFromBinding(i32, %dx.types.ResBind, attributes #0 = { nounwind } attributes #1 = { nounwind readnone } -!dx.targetTypes = !{!26} -!llvm.ident = !{!17} -!dx.version = !{!18} -!dx.valver = !{!18} -!dx.shaderModel = !{!19} -!dx.resources = !{!20} -!dx.entryPoints = !{!23} - -!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.LinAlgMatrixC0M128N128U0S0 undef, i32 0, i32 128, i32 128, i32 0, i32 0} +!dx.targetTypes = !{!0} +!llvm.ident = !{!1} +!dx.version = !{!2} +!dx.valver = !{!2} +!dx.shaderModel = !{!3} +!dx.resources = !{!4} +!dx.entryPoints = !{!7} + +!0 = !{%dx.types.LinAlgMatrixC0M16N16U0S0 undef, i32 0, i32 16, i32 16, i32 0, i32 0} +!1 = !{!"dxc(private) 1.9.0.15416 (main, 27579abe5)"} +!2 = !{i32 1, i32 10} +!3 = !{!"cs", i32 6, i32 10} +!4 = !{!5, null, null, null} +!5 = !{!6} +!6 = !{i32 0, %struct.ByteAddressBuffer* undef, !"", i32 0, i32 0, i32 1, i32 11, i32 0, null} +!7 = !{void ()* @main, !"main", null, !4, !8} +!8 = !{i32 0, i64 8388624, i32 4, !9} +!9 = !{i32 1, i32 1, i32 1} diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-matrixloadfromdescriptor.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-matrixloadfromdescriptor.ll index f97e2eb7de..7ea968efd4 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-matrixloadfromdescriptor.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-matrixloadfromdescriptor.ll @@ -1,6 +1,6 @@ ; 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 datalayout = "e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:16-f32:32-f64:64-n8:16:32:64" target triple = "dxil-ms-dx" %dx.types.Handle = type { i8* } @@ -12,34 +12,83 @@ target triple = "dxil-ms-dx" %dx.types.LinAlgMatrixC8M8N8U2S0 = type { i8* } %dx.types.LinAlgMatrixC8M16N16U2S0 = type { i8* } %dx.types.LinAlgMatrixC8M4N8U2S0 = type { i8* } +%dx.types.LinAlgMatrixC8M16N16U0S0 = type { i8* } +%dx.types.LinAlgMatrixC8M8N8U0S0 = type { i8* } +%dx.types.LinAlgMatrixC8M8N4U0S0 = type { i8* } +%dx.types.LinAlgMatrixC8M16N8U0S0 = type { i8* } %struct.ByteAddressBuffer = type { i32 } +%"class.StructuredBuffer" = type { i32 } +%struct.RWByteAddressBuffer = type { i32 } define void @main() { - %1 = call %dx.types.Handle @dx.op.createHandleFromBinding(i32 217, %dx.types.ResBind zeroinitializer, i32 0, i1 false) ; CreateHandleFromBinding(bind,index,nonUniformIndex) - %2 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + %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) + %2 = call %dx.types.Handle @dx.op.createHandleFromBinding(i32 217, %dx.types.ResBind { i32 1, i32 1, i32 0, i8 0 }, i32 1, i1 false) ; CreateHandleFromBinding(bind,index,nonUniformIndex) + %3 = call %dx.types.Handle @dx.op.createHandleFromBinding(i32 217, %dx.types.ResBind zeroinitializer, i32 0, i1 false) ; CreateHandleFromBinding(bind,index,nonUniformIndex) + %4 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %3, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + ; CHECK: Function: main: error: Matrix scope 'ThreadGroup' requires layout RowMajor or ColumnMajor. ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromDescriptor.mC8M4N4U2S2 - %3 = call %dx.types.LinAlgMatrixC8M4N4U2S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M4N4U2S2(i32 -2147483634, %dx.types.Handle %2, i32 0, i32 0, i32 4, i32 0) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) - %4 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + %5 = call %dx.types.LinAlgMatrixC8M4N4U2S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M4N4U2S2(i32 -2147483634, %dx.types.Handle %4, i32 0, i32 0, i32 4, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) + %6 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %3, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + + ; CHECK-NEXT: Function: main: error: Matrix layout 'OuterProductOptimal' requires stride 0. ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromDescriptor.mC8M4N4U2S0 - %5 = call %dx.types.LinAlgMatrixC8M4N4U2S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M4N4U2S0(i32 -2147483634, %dx.types.Handle %4, i32 0, i32 4, i32 4, i32 0) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) - %6 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer - %7 = call %dx.types.ResRet.i32 @dx.op.rawBufferLoad.i32(i32 139, %dx.types.Handle %6, i32 0, i32 undef, i8 1, i32 4) ; RawBufferLoad(srv,index,elementOffset,mask,alignment) - %8 = extractvalue %dx.types.ResRet.i32 %7, 0 + %7 = call %dx.types.LinAlgMatrixC8M4N4U2S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M4N4U2S0(i32 -2147483634, %dx.types.Handle %6, i32 0, i32 4, i32 4, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) + %8 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %2, %dx.types.ResourceProperties { i32 12, i32 4 }) ; AnnotateHandle(res,props) resource: StructuredBuffer + %9 = call %dx.types.ResRet.i32 @dx.op.rawBufferLoad.i32(i32 139, %dx.types.Handle %8, i32 0, i32 0, i8 1, i32 4) ; RawBufferLoad(srv,index,elementOffset,mask,alignment) + %10 = extractvalue %dx.types.ResRet.i32 %9, 0 + %11 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %3, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + + ; CHECK-NEXT: Function: main: error: Layout of LinAlgMatrixLoadFromDescriptor must be an immediate constant. ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromDescriptor.mC8M8N8U2S0 - %9 = call %dx.types.LinAlgMatrixC8M8N8U2S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M8N8U2S0(i32 -2147483634, %dx.types.Handle %6, i32 0, i32 0, i32 %8, i32 0) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) - %10 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + %12 = call %dx.types.LinAlgMatrixC8M8N8U2S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M8N8U2S0(i32 -2147483634, %dx.types.Handle %11, i32 0, i32 0, i32 %10, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) + %13 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %3, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + + ; CHECK-NEXT: Function: main: error: Stride of LinAlgMatrixLoadFromDescriptor must be an immediate constant. ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N16U2S0 - %11 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N16U2S0(i32 -2147483634, %dx.types.Handle %10, i32 0, i32 %8, i32 4, i32 0) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) - %12 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + %14 = call %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N16U2S0(i32 -2147483634, %dx.types.Handle %13, i32 0, i32 %10, i32 4, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) + %15 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %3, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + + ; No error expected for non-imm arg stride on row/col layout - %13 = call %dx.types.LinAlgMatrixC8M4N8U2S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M4N8U2S0(i32 -2147483634, %dx.types.Handle %12, i32 0, i32 %8, i32 0, i32 0) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) - ret void + %16 = call %dx.types.LinAlgMatrixC8M4N8U2S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M4N8U2S0(i32 -2147483634, %dx.types.Handle %15, i32 0, i32 %10, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) + %17 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %3, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + + + ; CHECK-NEXT: Function: main: error: parameter 'Align' must be a multiple of 128, got 215 + ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromDescriptor.mC8M4N8U2S0 + %18 = call %dx.types.LinAlgMatrixC8M4N8U2S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M4N8U2S0(i32 -2147483634, %dx.types.Handle %17, i32 0, i32 0, i32 0, i32 215) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) + %19 = 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-NEXT: Function: main: error: Loading matrix with Thread scope requires ByteAddressBuffer. + ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N16U0S0 + %20 = call %dx.types.LinAlgMatrixC8M16N16U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N16U0S0(i32 -2147483634, %dx.types.Handle %19, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) + %21 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %3, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + + + ; CHECK-NEXT: Function: main: error: Align of LinAlgMatrixLoadFromDescriptor must be an immediate constant. + ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromDescriptor.mC8M8N8U0S0 + %22 = call %dx.types.LinAlgMatrixC8M8N8U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M8N8U0S0(i32 -2147483634, %dx.types.Handle %21, i32 0, i32 0, i32 0, i32 %10) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) + %23 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %2, %dx.types.ResourceProperties { i32 12, i32 4 }) ; AnnotateHandle(res,props) resource: StructuredBuffer + + + ; CHECK-NEXT: Function: main: error: Loading matrix with Thread scope requires ByteAddressBuffer. + ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromDescriptor.mC8M8N4U0S0 + %24 = call %dx.types.LinAlgMatrixC8M8N4U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M8N4U0S0(i32 -2147483634, %dx.types.Handle %23, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) + %25 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %3, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + + + ; CHECK-NEXT: Function: main: error: parameter 'Align' must be greater than 0, got 0 + ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N8U0S0 + %26 = call %dx.types.LinAlgMatrixC8M16N8U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N8U0S0(i32 -2147483634, %dx.types.Handle %25, i32 0, i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) + ; CHECK-NEXT: Validation failed. + ret void } ; Function Attrs: nounwind @@ -60,6 +109,18 @@ declare %dx.types.LinAlgMatrixC8M16N16U2S0 @dx.op.linAlgMatrixLoadFromDescriptor ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC8M4N8U2S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M4N8U2S0(i32, %dx.types.Handle, i32, i32, i32, i32) #0 +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC8M16N16U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N16U0S0(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC8M8N8U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M8N8U0S0(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC8M8N4U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M8N4U0S0(i32, %dx.types.Handle, i32, i32, i32, i32) #0 + +; Function Attrs: nounwind +declare %dx.types.LinAlgMatrixC8M16N8U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N8U0S0(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) #2 @@ -70,25 +131,34 @@ attributes #0 = { nounwind } attributes #1 = { nounwind readonly } attributes #2 = { nounwind readnone } -!dx.targetTypes = !{!0, !1, !2, !3, !4} -!llvm.ident = !{!5} -!dx.version = !{!6} -!dx.valver = !{!6} -!dx.shaderModel = !{!7} -!dx.resources = !{!8} -!dx.entryPoints = !{!11} +!dx.targetTypes = !{!0, !1, !2, !3, !4, !5, !6, !7, !8} +!llvm.ident = !{!9} +!dx.version = !{!10} +!dx.valver = !{!10} +!dx.shaderModel = !{!11} +!dx.resources = !{!12} +!dx.entryPoints = !{!19} !0 = !{%dx.types.LinAlgMatrixC8M4N4U2S2 undef, i32 8, i32 4, i32 4, i32 2, i32 2} !1 = !{%dx.types.LinAlgMatrixC8M4N4U2S0 undef, i32 8, i32 4, i32 4, i32 2, i32 0} !2 = !{%dx.types.LinAlgMatrixC8M8N8U2S0 undef, i32 8, i32 8, i32 8, i32 2, i32 0} !3 = !{%dx.types.LinAlgMatrixC8M16N16U2S0 undef, i32 8, i32 16, i32 16, i32 2, i32 0} !4 = !{%dx.types.LinAlgMatrixC8M4N8U2S0 undef, i32 8, i32 4, i32 8, i32 2, i32 0} -!5 = !{!"dxc(private) 1.9.0.5397 (linalg-validation-matrixaccumulate, b4a61ea75-dirty)"} -!6 = !{i32 1, i32 10} -!7 = !{!"cs", i32 6, i32 10} -!8 = !{!9, null, null, null} -!9 = !{!10} -!10 = !{i32 0, %struct.ByteAddressBuffer* undef, !"", i32 0, i32 0, i32 1, i32 11, i32 0, null} -!11 = !{void ()* @main, !"main", null, !8, !12} -!12 = !{i32 0, i64 16, i32 4, !13} -!13 = !{i32 1, i32 1, i32 1} +!5 = !{%dx.types.LinAlgMatrixC8M16N16U0S0 undef, i32 8, i32 16, i32 16, i32 0, i32 0} +!6 = !{%dx.types.LinAlgMatrixC8M8N8U0S0 undef, i32 8, i32 8, i32 8, i32 0, i32 0} +!7 = !{%dx.types.LinAlgMatrixC8M8N4U0S0 undef, i32 8, i32 8, i32 4, i32 0, i32 0} +!8 = !{%dx.types.LinAlgMatrixC8M16N8U0S0 undef, i32 8, i32 16, i32 8, i32 0, i32 0} +!9 = !{!"dxc(private) 1.9.0.5417 (linalg-vali-matrixloadfromdescriptor, 31c54f018-dirty)"} +!10 = !{i32 1, i32 10} +!11 = !{!"cs", i32 6, i32 10} +!12 = !{!13, !17, null, null} +!13 = !{!14, !15} +!14 = !{i32 0, %struct.ByteAddressBuffer* undef, !"", i32 0, i32 0, i32 1, i32 11, i32 0, null} +!15 = !{i32 1, %"class.StructuredBuffer"* undef, !"", i32 0, i32 1, i32 1, i32 12, i32 0, !16} +!16 = !{i32 1, i32 4} +!17 = !{!18} +!18 = !{i32 0, %struct.RWByteAddressBuffer* undef, !"", i32 0, i32 0, i32 1, i32 11, i1 false, i1 false, i1 false, null} +!19 = !{void ()* @main, !"main", null, !12, !20} +!20 = !{i32 0, i64 8598323216, i32 4, !21} +!21 = !{i32 1, i32 1, i32 1} + diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-max-k-dim.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-max-k-dim.ll index b67e369a68..52b8673d24 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-max-k-dim.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-max-k-dim.ll @@ -1,175 +1,197 @@ ; 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 datalayout = "e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:16-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 } %dx.types.LinAlgMatrixC8M1025N1025U2S0 = type { i8* } -%dx.types.LinAlgMatrixC8M16N129U0S0 = type { i8* } +%dx.types.LinAlgMatrixC4M16N16U0S2 = type { i8* } %dx.types.LinAlgMatrixC8M129N16U0S0 = type { i8* } -%dx.types.LinAlgMatrixC8M16N3U0S0 = type { i8* } +%dx.types.LinAlgMatrixC8M16N129U0S0 = type { i8* } %dx.types.LinAlgMatrixC8M3N16U0S0 = type { i8* } -%dx.types.LinAlgMatrixC8M16N129U1S0 = type { i8* } +%dx.types.LinAlgMatrixC8M16N3U0S0 = type { i8* } %dx.types.LinAlgMatrixC8M129N16U1S0 = type { i8* } -%dx.types.LinAlgMatrixC8M16N3U1S0 = type { i8* } +%dx.types.LinAlgMatrixC8M16N129U1S0 = type { i8* } %dx.types.LinAlgMatrixC8M3N16U1S0 = type { i8* } -%dx.types.LinAlgMatrixC8M16N1025U0S2 = type { i8* } +%dx.types.LinAlgMatrixC8M16N3U1S0 = type { i8* } %dx.types.LinAlgMatrixC8M1025N16U0S2 = type { i8* } +%dx.types.LinAlgMatrixC8M16N1025U0S2 = type { i8* } %dx.types.LinAlgMatrixC8M16N0U0S2 = type { i8* } %dx.types.LinAlgMatrixC8M3N16U0S2 = type { i8* } -%dx.types.LinAlgMatrixC8M129N1025U1S2 = type { i8* } %dx.types.LinAlgMatrixC8M1025N129U1S2 = type { i8* } -%dx.types.LinAlgMatrixC8M129N3U1S2 = type { i8* } +%dx.types.LinAlgMatrixC8M129N1025U1S2 = type { i8* } %dx.types.LinAlgMatrixC8M0N129U1S2 = type { i8* } +%dx.types.LinAlgMatrixC8M129N3U1S2 = 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 } +%struct.ByteAddressBuffer = 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 + %1 = call %dx.types.Handle @dx.op.createHandleFromBinding(i32 217, %dx.types.ResBind zeroinitializer, i32 0, i1 false) ; CreateHandleFromBinding(bind,index,nonUniformIndex) ; 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) + %2 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + %3 = call %dx.types.LinAlgMatrixC8M1025N1025U2S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M1025N1025U2S0(i32 -2147483634, %dx.types.Handle %2, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) ; CHECK: Function: main: error: Metadata must be well-formed in operand count and types. - ; CHECK-NEXT: note: at '%mC4M16N16U0S2 + ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromDescriptor.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) + %4 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + %5 = call %dx.types.LinAlgMatrixC4M16N16U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M16N16U0S2(i32 -2147483634, %dx.types.Handle %4, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) ; CHECK-NEXT: Function: main: error: Matrix K Dimension out of bounds. K=129 must be >= 4 and <= 128. - ; CHECK-NEXT: note: at '%mC8M16N129U0S0 + ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromDescriptor.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) + %6 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + %7 = call %dx.types.LinAlgMatrixC8M129N16U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M129N16U0S0(i32 -2147483634, %dx.types.Handle %6, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) ; 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) + %8 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + %9 = call %dx.types.LinAlgMatrixC8M16N129U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N129U0S0(i32 -2147483634, %dx.types.Handle %8, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) ; CHECK-NEXT: Function: main: error: Matrix K Dimension out of bounds. K=3 must be >= 4 and <= 128. - ; CHECK-NEXT: note: at '%mC8M16N3U0S0 + ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromDescriptor.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) + %10 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + %11 = call %dx.types.LinAlgMatrixC8M3N16U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M3N16U0S0(i32 -2147483634, %dx.types.Handle %10, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) ; 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) + %12 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + %13 = call %dx.types.LinAlgMatrixC8M16N3U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N3U0S0(i32 -2147483634, %dx.types.Handle %12, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) ; CHECK-NEXT: Function: main: error: Matrix K Dimension out of bounds. K=129 must be >= 4 and <= 128. - ; CHECK-NEXT: note: at '%mC8M129N16U1S0 + ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromDescriptor.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) + %14 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + %15 = call %dx.types.LinAlgMatrixC8M129N16U1S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M129N16U1S0(i32 -2147483634, %dx.types.Handle %14, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) ; 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) + %16 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + %17 = call %dx.types.LinAlgMatrixC8M16N129U1S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N129U1S0(i32 -2147483634, %dx.types.Handle %16, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) ; CHECK-NEXT: Function: main: error: Matrix K Dimension out of bounds. K=3 must be >= 4 and <= 128. - ; CHECK-NEXT: note: at '%mC8M3N16U1S0 + ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromDescriptor.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) + %18 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + %19 = call %dx.types.LinAlgMatrixC8M3N16U1S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M3N16U1S0(i32 -2147483634, %dx.types.Handle %18, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) ; 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) + %20 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + %21 = call %dx.types.LinAlgMatrixC8M16N3U1S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N3U1S0(i32 -2147483634, %dx.types.Handle %20, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) ; CHECK-NEXT: Function: main: error: Matrix K Dimension out of bounds. K=1025 must be >= 1 and <= 1024. - ; CHECK-NEXT: note: at '%mC8M16N1025U0S2 + ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromDescriptor.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) + %22 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + %23 = call %dx.types.LinAlgMatrixC8M1025N16U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M1025N16U0S2(i32 -2147483634, %dx.types.Handle %22, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) ; 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) + %24 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + %25 = call %dx.types.LinAlgMatrixC8M16N1025U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N1025U0S2(i32 -2147483634, %dx.types.Handle %24, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) ; CHECK-NEXT: Function: main: error: Matrix K Dimension out of bounds. K=0 must be >= 1 and <= 1024. - ; CHECK-NEXT: note: at '%mC8M16N0U0S2 + ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N0U0S2 ; Matrix - N is K so fail - %mC8M16N0U0S2 = call %dx.types.LinAlgMatrixC8M16N0U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N0U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + %26 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + %27 = call %dx.types.LinAlgMatrixC8M16N0U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N0U0S2(i32 -2147483634, %dx.types.Handle %26, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) ; 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) + %28 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + %29 = call %dx.types.LinAlgMatrixC8M3N16U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M3N16U0S2(i32 -2147483634, %dx.types.Handle %28, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) ; CHECK-NEXT: Function: main: error: Matrix K Dimension out of bounds. K=1025 must be >= 1 and <= 1024. - ; CHECK-NEXT: note: at '%mC8M1025N129U1S2 + ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromDescriptor.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) + %30 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + %31 = call %dx.types.LinAlgMatrixC8M1025N129U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M1025N129U1S2(i32 -2147483634, %dx.types.Handle %30, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) ; 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) + %32 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + %33 = call %dx.types.LinAlgMatrixC8M129N1025U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M129N1025U1S2(i32 -2147483634, %dx.types.Handle %32, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) ; CHECK-NEXT: Function: main: error: Matrix K Dimension out of bounds. K=0 must be >= 1 and <= 1024. - ; CHECK-NEXT: note: at '%mC8M0N129U1S2 + ; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromDescriptor.mC8M0N129U1S2 ; Matrix - M is K so fail - %mC8M0N129U1S2 = call %dx.types.LinAlgMatrixC8M0N129U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M0N129U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + %34 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + %35 = call %dx.types.LinAlgMatrixC8M0N129U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M0N129U1S2(i32 -2147483634, %dx.types.Handle %34, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) ; 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) - + %36 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + %37 = call %dx.types.LinAlgMatrixC8M129N3U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M129N3U1S2(i32 -2147483634, %dx.types.Handle %36, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) ; 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) + %38 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + %39 = call %dx.types.LinAlgMatrixC8M128N128U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M128N128U0S0(i32 -2147483634, %dx.types.Handle %38, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) + ; Matrix - %mC8M128N128U1S0 = call %dx.types.LinAlgMatrixC8M128N128U1S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M128N128U1S0(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + %40 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + %41 = call %dx.types.LinAlgMatrixC8M128N128U1S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M128N128U1S0(i32 -2147483634, %dx.types.Handle %40, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) + ; Matrix - %mC8M1024N1024U0S2 = call %dx.types.LinAlgMatrixC8M1024N1024U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M1024N1024U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + %42 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + %43 = call %dx.types.LinAlgMatrixC8M1024N1024U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M1024N1024U0S2(i32 -2147483634, %dx.types.Handle %42, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) + ; Matrix - %mC8M1024N1024U1S2 = call %dx.types.LinAlgMatrixC8M1024N1024U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M1024N1024U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 0) + %44 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer + %45 = call %dx.types.LinAlgMatrixC8M1024N1024U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M1024N1024U1S2(i32 -2147483634, %dx.types.Handle %44, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) ; 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 +declare %dx.types.LinAlgMatrixC4M16N16U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M16N16U0S2(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 +declare %dx.types.LinAlgMatrixC8M16N129U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N129U0S0(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 +declare %dx.types.LinAlgMatrixC8M16N3U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N3U0S0(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 +declare %dx.types.LinAlgMatrixC8M16N129U1S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N129U1S0(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 +declare %dx.types.LinAlgMatrixC8M16N3U1S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N3U1S0(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.LinAlgMatrixC8M16N0U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N0U0S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 +declare %dx.types.LinAlgMatrixC8M16N1025U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N1025U0S2(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 +declare %dx.types.LinAlgMatrixC8M16N0U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N0U0S2(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 +declare %dx.types.LinAlgMatrixC8M3N16U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M3N16U0S2(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 +declare %dx.types.LinAlgMatrixC8M129N1025U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M129N1025U1S2(i32, %dx.types.Handle, i32, i32, i32, i32) #0 ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC8M0N129U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M0N129U1S2(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.LinAlgMatrixC8M128N128U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M128N128U0S0(i32, %dx.types.Handle, i32, i32, i32, i32) #0 @@ -191,41 +213,44 @@ declare %dx.types.Handle @dx.op.createHandleFromBinding(i32, %dx.types.ResBind, 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} +; !1 is intentionally removed. See below. +!dx.targetTypes = !{!0, !2, !3, !4, !5, !6, !7, !8, !9, !10, !11, !12, !13, !14, !15, !16, !17, !18, !19, !20, !21} +!llvm.ident = !{!22} +!dx.version = !{!23} +!dx.valver = !{!23} +!dx.shaderModel = !{!24} +!dx.resources = !{!25} +!dx.entryPoints = !{!28} !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} +; Below is intentionally removed to cause a missing metadata error +; !1 = !{%dx.types.LinAlgMatrixC4M16N16U0S2 undef, i32 4, i32 16, i32 16, i32 0, i32 2} !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} +!3 = !{%dx.types.LinAlgMatrixC8M16N129U0S0 undef, i32 8, i32 16, i32 129, 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} +!5 = !{%dx.types.LinAlgMatrixC8M16N3U0S0 undef, i32 8, i32 16, i32 3, i32 0, 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} +!7 = !{%dx.types.LinAlgMatrixC8M16N129U1S0 undef, i32 8, i32 16, i32 129, 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} +!9 = !{%dx.types.LinAlgMatrixC8M16N3U1S0 undef, i32 8, i32 16, i32 3, i32 1, i32 0} !10 = !{%dx.types.LinAlgMatrixC8M1025N16U0S2 undef, i32 8, i32 1025, i32 16, i32 0, i32 2} -!11 = !{%dx.types.LinAlgMatrixC8M16N0U0S2 undef, i32 8, i32 16, i32 0, 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} +!11 = !{%dx.types.LinAlgMatrixC8M16N1025U0S2 undef, i32 8, i32 16, i32 1025, i32 0, i32 2} +!12 = !{%dx.types.LinAlgMatrixC8M16N0U0S2 undef, i32 8, i32 16, i32 0, i32 0, i32 2} +!13 = !{%dx.types.LinAlgMatrixC8M3N16U0S2 undef, i32 8, i32 3, i32 16, i32 0, 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} +!15 = !{%dx.types.LinAlgMatrixC8M129N1025U1S2 undef, i32 8, i32 129, i32 1025, i32 1, i32 2} !16 = !{%dx.types.LinAlgMatrixC8M0N129U1S2 undef, i32 8, i32 0, 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} +!17 = !{%dx.types.LinAlgMatrixC8M129N3U1S2 undef, i32 8, i32 129, i32 3, i32 1, i32 2} +!18 = !{%dx.types.LinAlgMatrixC8M128N128U0S0 undef, i32 8, i32 128, i32 128, i32 0, i32 0} +!19 = !{%dx.types.LinAlgMatrixC8M128N128U1S0 undef, i32 8, i32 128, i32 128, i32 1, i32 0} +!20 = !{%dx.types.LinAlgMatrixC8M1024N1024U0S2 undef, i32 8, i32 1024, i32 1024, i32 0, i32 2} +!21 = !{%dx.types.LinAlgMatrixC8M1024N1024U1S2 undef, i32 8, i32 1024, i32 1024, i32 1, i32 2} +!22 = !{!"dxc(private) 1.9.0.15416 (main, 27579abe5)"} +!23 = !{i32 1, i32 10} +!24 = !{!"cs", i32 6, i32 10} +!25 = !{!26, null, null, null} +!26 = !{!27} +!27 = !{i32 0, %struct.ByteAddressBuffer* undef, !"", i32 0, i32 0, i32 1, i32 11, i32 0, null} +!28 = !{void ()* @main, !"main", null, !25, !29} +!29 = !{i32 0, i64 8388624, i32 4, !30} +!30 = !{i32 1, i32 1, i32 1} diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ms.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ms.ll index 183e4b9948..ff9a7c7174 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ms.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ms.ll @@ -54,8 +54,8 @@ 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) + %mC4M5N4U0S2 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) + %mC4M4N5U1S2 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) ; dx.op.linAlgMatrixAccumulate %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.LinAlgMatrixC4M4N5U1S2 %mC4M4N5U1S2) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) @@ -67,7 +67,7 @@ define void @mainMeS() { %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 0, i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) + %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) ; dx.op.linAlgMatrixOuterProduct %v4 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483619, <4 x i32> , <4 x i32> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-node.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-node.ll index 96f1cca57d..162fc8f32f 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-node.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-node.ll @@ -55,8 +55,8 @@ 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) + %mC4M5N4U0S2 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) + %mC4M4N5U1S2 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) ; dx.op.linAlgMatrixAccumulate %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.LinAlgMatrixC4M4N5U1S2 %mC4M4N5U1S2) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) @@ -68,7 +68,7 @@ define void @mainNS() { %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 0, i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) + %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) ; dx.op.linAlgMatrixOuterProduct %v4 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483619, <4 x i32> , <4 x i32> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ps.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ps.ll index 2f15caef81..ecc05586f9 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ps.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ps.ll @@ -54,8 +54,8 @@ 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) + %mC4M5N4U0S2 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) + %mC4M4N5U1S2 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) ; dx.op.linAlgMatrixAccumulate %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.LinAlgMatrixC4M4N5U1S2 %mC4M4N5U1S2) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) @@ -67,7 +67,7 @@ define void @mainPS() { %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 0, i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) + %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) ; dx.op.linAlgMatrixOuterProduct %v4 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483619, <4 x i32> , <4 x i32> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-raytracing.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-raytracing.ll index a16cf24b23..d6bb4a7ada 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-raytracing.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-raytracing.ll @@ -219,13 +219,13 @@ define void @"\01?MainRG@@YAXXZ"() #0 { ; ; 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) + %mC4M5N4U0S2 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) + %mC4M4N5U1S2 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) %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 0, i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout) + %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) ; 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() %v6 = call <4 x i32> @dx.op.linAlgMatVecMul.v4i32.mC4M5N4U0S2.v4i32(i32 -2147483623, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 1) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) @@ -259,13 +259,13 @@ define void @"\01?MainIS@@YAXXZ"() #0 { ; ; 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) + %mC4M5N4U0S2 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) + %mC4M4N5U1S2 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) %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 0, i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout) + %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) ; 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() %v6 = call <4 x i32> @dx.op.linAlgMatVecMul.v4i32.mC4M5N4U0S2.v4i32(i32 -2147483623, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 1) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) @@ -299,13 +299,13 @@ define void @"\01?MainCL@@YAXUAttribs@@@Z"(%struct.Attribs* noalias nocapture %a ; ; 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) + %mC4M5N4U0S2 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) + %mC4M4N5U1S2 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) %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 0, i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout) + %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) ; 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() %v6 = call <4 x i32> @dx.op.linAlgMatVecMul.v4i32.mC4M5N4U0S2.v4i32(i32 -2147483623, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 1) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) @@ -339,13 +339,13 @@ define void @"\01?MainAH@@YAXURayPayload@@UAttribs@@@Z"(%struct.RayPayload* noal ; ; 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) + %mC4M5N4U0S2 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) + %mC4M4N5U1S2 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) %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 0, i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout) + %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) ; 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() %v6 = call <4 x i32> @dx.op.linAlgMatVecMul.v4i32.mC4M5N4U0S2.v4i32(i32 -2147483623, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 1) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) @@ -379,13 +379,13 @@ define void @"\01?MainCH@@YAXURayPayload@@UAttribs@@@Z"(%struct.RayPayload* noal ; ; 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) + %mC4M5N4U0S2 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) + %mC4M4N5U1S2 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) %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 0, i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout) + %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) ; 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() %v6 = call <4 x i32> @dx.op.linAlgMatVecMul.v4i32.mC4M5N4U0S2.v4i32(i32 -2147483623, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 1) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) @@ -419,13 +419,13 @@ define void @"\01?MainMS@@YAXURayPayload@@@Z"(%struct.RayPayload* noalias nocapt ; ; 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) + %mC4M5N4U0S2 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) + %mC4M4N5U1S2 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) %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 0, i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout) + %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) ; 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() %v6 = call <4 x i32> @dx.op.linAlgMatVecMul.v4i32.mC4M5N4U0S2.v4i32(i32 -2147483623, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 1) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-vs.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-vs.ll index d3a6b1a3d0..4ec2f8f808 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-vs.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-vs.ll @@ -55,8 +55,8 @@ 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) + %mC4M5N4U0S2 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) + %mC4M4N5U1S2 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M4N5U1S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) ; dx.op.linAlgMatrixAccumulate %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 %mC4M5N4U0S2, %dx.types.LinAlgMatrixC4M4N5U1S2 %mC4M4N5U1S2) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) @@ -68,7 +68,7 @@ define void @mainVS() { %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 0, i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) + %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) ; dx.op.linAlgMatrixOuterProduct %v4 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483619, <4 x i32> , <4 x i32> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) diff --git a/utils/hct/hctdb.py b/utils/hct/hctdb.py index 924da2f148..0fabc9a8ac 100644 --- a/utils/hct/hctdb.py +++ b/utils/hct/hctdb.py @@ -8626,6 +8626,11 @@ def build_valrules(self): "Parameter must be a valid multiple", "parameter '%0' must be a multiple of %1, got %2", ) + self.add_valrule_msg( + "Instr.ParamMinimumValue", + "Parameter must be greater than a minimum value", + "parameter '%0' must be greater than %1, got %2", + ) self.add_valrule( "Instr.MayReorderThreadUndefCoherenceHintParam", "Use of undef coherence hint or num coherence hint bits in MaybeReorderThread.", @@ -8674,6 +8679,10 @@ def build_valrules(self): "Instr.LinAlgMatrixLayoutReqStride", "Matrix layout '%0' requires stride 0.", ) + self.add_valrule( + "Instr.LinAlgMatrixLoadThreadRequiresBAB", + "Loading matrix with Thread scope requires ByteAddressBuffer.", + ) # Some legacy rules: # - space is only supported for shader targets 5.1 and higher