Skip to content

Commit 2ab3146

Browse files
committed
[SM6.10] Add -fcgl variant to LinAlg Matrix codegen tests
1 parent 36b93d5 commit 2ab3146

16 files changed

Lines changed: 120 additions & 17 deletions

File tree

tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/copyconvertmatrix/nominal.hlsl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
// REQUIRES: dxil-1-10
22
// RUN: %dxc -T cs_6_10 -E main %s | FileCheck %s
3+
// RUN: %dxc -T cs_6_10 -E main -fcgl %s | FileCheck %s --check-prefix=CHECK2
34

45
[numthreads(1,1,1)]
56
void main() {
67
// CHECK-LABEL: define void @main()
78

8-
// CHECK: call %dx.types.LinAlgMatrixC4M5N4U1S2 @dx.op.linAlgCopyConvertMatrix.mC4M5N4U1S2.mC2M5N4U1S2(i32 -2147483635, %dx.types.LinAlgMatrixC2M5N4U1S2 {{.*}}, i1 false) ; LinAlgCopyConvertMatrix(srcMatrix,transpose)
9+
// CHECK: call %dx.types.LinAlgMatrixC4M5N4U1S2 @dx.op.linAlgCopyConvertMatrix.mC4M5N4U1S2.mC2M5N4U1S2
10+
// CHECK-SAME: (i32 -2147483635, %dx.types.LinAlgMatrixC2M5N4U1S2 {{.*}}, i1 false)
11+
// CHECK-SAME: ; LinAlgCopyConvertMatrix(srcMatrix,transpose)
12+
13+
// CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC4M5N4U1S2*, %dx.types.LinAlgMatrixC2M5N4U1S2, i1)"
14+
// CHECK2-SAME: (i32 405, %dx.types.LinAlgMatrixC4M5N4U1S2* {{.*}}, %dx.types.LinAlgMatrixC2M5N4U1S2 {{.*}}, i1 false)
915
__builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(2, 5, 4, 1, 2)]] mat1;
1016
__builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat2;
1117
__builtin_LinAlg_CopyConvertMatrix(mat2, mat1, false);
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
// REQUIRES: dxil-1-10
22
// RUN: %dxc -T cs_6_10 -E main %s | FileCheck %s
3+
// RUN: %dxc -T cs_6_10 -E main -fcgl %s | FileCheck %s --check-prefix=CHECK2
34

45
[numthreads(1,1,1)]
56
void main() {
67
// CHECK-LABEL: define void @main()
78

89
// CHECK: %{{.*}} = call %dx.types.LinAlgMatrixC4M5N4U1S2 @dx.op.linAlgFillMatrix.mC4M5N4U1S2.i32(i32 -2147483636, i32 {{.*}}) ; LinAlgFillMatrix(value)
10+
// CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC4M5N4U1S2*, i32)"(i32 406, %dx.types.LinAlgMatrixC4M5N4U1S2* {{.*}}, i32 5),
911
__builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat1;
1012
__builtin_LinAlg_FillMatrix(mat1, 5);
13+
1114
// CHECK: %{{.*}} = call %dx.types.LinAlgMatrixC5M3N4U0S0 @dx.op.linAlgFillMatrix.mC5M3N4U0S0.f32(i32 -2147483636, float {{.*}}) ; LinAlgFillMatrix(value)
15+
// CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC5M3N4U0S0*, float)"(i32 406, %dx.types.LinAlgMatrixC5M3N4U0S0* {{.*}}, float 0x40091EB860000000)
1216
__builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(5, 3, 4, 0, 0)]] mat2;
1317
__builtin_LinAlg_FillMatrix(mat2, 3.14);
1418
}
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// REQUIRES: dxil-1-10
22
// RUN: %dxc -T cs_6_10 -E main %s | FileCheck %s
3+
// RUN: %dxc -T cs_6_10 -E main -fcgl %s | FileCheck %s --check-prefix=CHECK2
34

45
[numthreads(1,1,1)]
56
void main() {
@@ -8,7 +9,12 @@ void main() {
89
__builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(5, 3, 4, 0, 0)]] mat1;
910
__builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(1, 1, 1, 0, 0)]] mat2;
1011
__builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(2, 2, 2, 2, 2)]] mat3;
12+
13+
// CHECK: call %dx.types.LinAlgMatrixC2M2N2U2S2 @dx.op.linAlgMatrixAccumulate.mC2M2N2U2S2.mC1M1N1U0S0.mC5M3N4U0S
14+
// CHECK-SAME: (i32 -2147483624, %dx.types.LinAlgMatrixC1M1N1U0S0 {{.*}}, %dx.types.LinAlgMatrixC5M3N4U0S0 {{.*}}) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS)
1115

12-
// CHECK: call %dx.types.LinAlgMatrixC2M2N2U2S2 @dx.op.linAlgMatrixAccumulate.mC2M2N2U2S2.mC1M1N1U0S0.mC5M3N4U0S0(i32 -2147483624, %dx.types.LinAlgMatrixC1M1N1U0S0 {{.*}}, %dx.types.LinAlgMatrixC5M3N4U0S0 {{.*}}) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS)
16+
// CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC2M2N2U2S2*, %dx.types.LinAlgMatrixC1M1N1U0S0,
17+
// CHECK2" %dx.types.LinAlgMatrixC5M3N4U0S0)"(i32 415, %dx.types.LinAlgMatrixC2M2N2U2S2* {{.*}},
18+
// CHECK2" %dx.types.LinAlgMatrixC1M1N1U0S0 {{.*}}, %dx.types.LinAlgMatrixC5M3N4U0S0 {{.*}})
1319
__builtin_LinAlg_MatrixAccumulate(mat3, mat2, mat1);
1420
}
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
// REQUIRES: dxil-1-10
22
// RUN: %dxc -T cs_6_10 -E main %s | FileCheck %s
3+
// RUN: %dxc -T cs_6_10 -E main -fcgl %s | FileCheck %s --check-prefix=CHECK2
34

45
RWByteAddressBuffer outbuf;
56

67
[numthreads(1,1,1)]
78
void main() {
89
// CHECK-LABEL: define void @main()
910

10-
// CHECK: call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U1S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, %dx.types.Handle %{{.*}}, i32 5, i32 5, i32 5) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout)
11+
// CHECK: call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U1S2(i32 -2147483621,
12+
// CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, %dx.types.Handle %{{.*}}, i32 5, i32 5, i32 5)
13+
// CHECK-SAME: ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout)
14+
15+
// CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC4M5N4U1S2, %dx.types.Handle, i32, i32, i32)"
16+
// CHECK2-SAME: (i32 419, %dx.types.LinAlgMatrixC4M5N4U1S2 %2, %dx.types.Handle {{.*}}, i32 5, i32 5, i32 5)
1117
__builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat;
1218
__builtin_LinAlg_MatrixAccumulateToDescriptor(mat, outbuf, 5, 5, 5);
1319
}
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
// REQUIRES: dxil-1-10
22
// RUN: %dxc -T cs_6_10 -E main %s | FileCheck %s
3+
// RUN: %dxc -T cs_6_10 -E main -fcgl %s | FileCheck %s --check-prefix=CHECK2
34

45
[numthreads(1,1,1)]
56
void main() {
67
// CHECK-LABEL: define void @main()
78

8-
// CHECK: call <2 x i32> @dx.op.linAlgMatrixGetCoordinate.mC4M5N4U1S2(i32 -2147483631, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i32 1) ; LinAlgMatrixGetCoordinate(matrix,threadLocalIndex)
9+
// CHECK: call <2 x i32> @dx.op.linAlgMatrixGetCoordinate.mC4M5N4U1S2(i32 -2147483631,
10+
// CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i32 1)
11+
// CHECK-SAME: ; LinAlgMatrixGetCoordinate(matrix,threadLocalIndex)
12+
13+
// CHECK2: call <2 x i32> @"dx.hl.op..<2 x i32> (i32, %dx.types.LinAlgMatrixC4M5N4U1S2, i32)"
14+
// CHECK2-SAME: (i32 407, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i32 1)
915
__builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat;
1016
uint2 coord = __builtin_LinAlg_MatrixGetCoordinate(mat, 1);
1117
}
Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
11
// REQUIRES: dxil-1-10
22
// RUN: %dxc -T cs_6_10 -E main %s | FileCheck %s
3+
// RUN: %dxc -T cs_6_10 -E main -fcgl %s | FileCheck %s --check-prefix=CHECK2
34

45
[numthreads(1,1,1)]
56
void main() {
67
// CHECK-LABEL: define void @main()
78

89
__builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat;
910

10-
// CHECK: call i32 @dx.op.linAlgMatrixGetElement.i32.mC4M5N4U1S2(i32 -2147483630, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i32 0) ; LinAlgMatrixGetElement(matrix,threadLocalIndex)
11+
// CHECK: call i32 @dx.op.linAlgMatrixGetElement.i32.mC4M5N4U1S2(i32 -2147483630,
12+
// CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i32 0)
13+
// CHECK-SAME: ; LinAlgMatrixGetElement(matrix,threadLocalIndex)
14+
15+
// CHECK2: call void @"dx.hl.op..void (i32, i32*, %dx.types.LinAlgMatrixC4M5N4U1S2, i32)"
16+
// CHECK2-SAME: (i32 408, i32* %elem1, %dx.types.LinAlgMatrixC4M5N4U1S2 %3, i32 0)
1117
uint elem1;
1218
__builtin_LinAlg_MatrixGetElement(elem1, mat, 0);
13-
// CHECK: call float @dx.op.linAlgMatrixGetElement.f32.mC4M5N4U1S2(i32 -2147483630, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i32 1) ; LinAlgMatrixGetElement(matrix,threadLocalIndex)
19+
20+
// CHECK: call float @dx.op.linAlgMatrixGetElement.f32.mC4M5N4U1S2(i32 -2147483630,
21+
// CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i32 1)
22+
// CHECK-SAME: ; LinAlgMatrixGetElement(matrix,threadLocalIndex)
23+
24+
// CHECK2: call void @"dx.hl.op..void (i32, float*, %dx.types.LinAlgMatrixC4M5N4U1S2, i32)"
25+
// CHECK2-SAME: (i32 408, float* %elem2, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i32 1)
1426
float elem2;
1527
__builtin_LinAlg_MatrixGetElement(elem2, mat, 1);
1628
}
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
// REQUIRES: dxil-1-10
22
// RUN: %dxc -T cs_6_10 -E main %s | FileCheck %s
3+
// RUN: %dxc -T cs_6_10 -E main -fcgl %s | FileCheck %s --check-prefix=CHECK2
34

45
[numthreads(1,1,1)]
56
void main() {
67
// CHECK-LABEL: define void @main()
78

8-
// CHECK: call i32 @dx.op.linAlgMatrixLength.mC4M5N4U1S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}) ; LinAlgMatrixLength(matrix)
9+
// CHECK: call i32 @dx.op.linAlgMatrixLength.mC4M5N4U1S2(i32 -2147483632,
10+
// CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}) ; LinAlgMatrixLength(matrix)
11+
12+
// CHECK2: call i32 @"dx.hl.op..i32 (i32, %dx.types.LinAlgMatrixC4M5N4U1S2)"
13+
// CHECK2-SAME: (i32 409, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}})
914
__builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat;
1015
uint len = __builtin_LinAlg_MatrixLength(mat);
1116
}
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
// REQUIRES: dxil-1-10
22
// RUN: %dxc -T cs_6_10 -E main %s | FileCheck %s
3+
// RUN: %dxc -T cs_6_10 -E main -fcgl %s | FileCheck %s --check-prefix=CHECK2
34

45
ByteAddressBuffer inbuf;
56

67
[numthreads(1,1,1)]
78
void main() {
89
// CHECK-LABEL: define void @main()
910

10-
// CHECK: %{{.*}} = call %dx.types.LinAlgMatrixC1M1N1U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC1M1N1U0S0(i32 -2147483634, %dx.types.Handle %{{.*}}, i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout)
11+
// CHECK: %{{.*}} = call %dx.types.LinAlgMatrixC1M1N1U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC1M1N1U0S0
12+
// CHECK-SAME: (i32 -2147483634, %dx.types.Handle %{{.*}}, i32 0, i32 0, i32 0)
13+
// CHECK-SAME: ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout)
14+
15+
// CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC1M1N1U0S0*, %dx.types.Handle, i32, i32, i32)
16+
// CHECK2-SAME: "(i32 410, %dx.types.LinAlgMatrixC1M1N1U0S0* %mat, %dx.types.Handle {{.*}}, i32 0, i32 0, i32 0)
1117
__builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(1, 1, 1, 0, 0)]] mat;
1218
__builtin_LinAlg_MatrixLoadFromDescriptor(mat, inbuf, 0, 0, 0);
1319
}

tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixmatrixmultiply/nominal.hlsl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
// REQUIRES: dxil-1-10
22
// RUN: %dxc -T cs_6_10 -E main %s | FileCheck %s
3+
// RUN: %dxc -T cs_6_10 -E main -fcgl %s | FileCheck %s --check-prefix=CHECK2
34

45
[numthreads(1,1,1)]
56
void main() {
67
// CHECK-LABEL: define void @main()
78

8-
// CHECK: call %dx.types.LinAlgMatrixC4M5N4U1S2 @dx.op.linAlgMatrixMultiply.mC4M5N4U1S2.mC4M5N4U1S2.mC4M5N4U1S2(i32 -2147483625, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}) ; LinAlgMatrixMultiply(matrixA,matrixB)
9+
// CHECK: call %dx.types.LinAlgMatrixC4M5N4U1S2 @dx.op.linAlgMatrixMultiply.mC4M5N4U1S2.mC4M5N4U1S2.mC4M5N4U1S2(i32 -2147483625,
10+
// CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}) ; LinAlgMatrixMultiply(matrixA,matrixB)
11+
12+
// CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC4M5N4U1S2*, %dx.types.LinAlgMatrixC4M5N4U1S2,
13+
// CHECK2-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2)"(i32 416, %dx.types.LinAlgMatrixC4M5N4U1S2* %mat2,
14+
// CHECK2-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 %{{[0-9]+}}, %dx.types.LinAlgMatrixC4M5N4U1S2 %{{[0-9]+}})
915
__builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat1;
1016
__builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat2;
1117
__builtin_LinAlg_MatrixMatrixMultiply(mat2, mat1, mat1);
Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
// REQUIRES: dxil-1-10
22
// RUN: %dxc -T cs_6_10 -E main %s | FileCheck %s
3+
// RUN: %dxc -T cs_6_10 -E main -fcgl %s | FileCheck %s --check-prefix=CHECK2
34

45
[numthreads(1,1,1)]
56
void main() {
67
// CHECK-LABEL: define void @main()
78

8-
// CHECK: call %dx.types.LinAlgMatrixC4M5N4U1S2 @dx.op.linAlgMatrixMultiplyAccumulate.mC4M5N4U1S2.mC4M5N4U1S2.mC4M5N4U1S2.mC4M5N4U1S2(i32 -2147483637, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}) ; LinAlgMatrixMultiplyAccumulate(matrixA,matrixB,matrixC)
9+
// CHECK: call %dx.types.LinAlgMatrixC4M5N3U1S2
10+
// CHECK-SAME: @dx.op.linAlgMatrixMultiplyAccumulate.mC4M5N3U1S2.mC4M5N4U1S2.mC4M4N3U1S2.mC4M5N3U1S2
11+
// CHECK-SAME: (i32 -2147483637, %dx.types.LinAlgMatrixC4M5N4U1S2 undef, %dx.types.LinAlgMatrixC4M4N3U1S2 undef,
12+
// CHECK-SAME: %dx.types.LinAlgMatrixC4M5N3U1S2 undef) ; LinAlgMatrixMultiplyAccumulate(matrixA,matrixB,matrixC)
13+
14+
// CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC4M5N3U1S2*, %dx.types.LinAlgMatrixC4M5N4U1S2,
15+
// CHECK2-SAME: %dx.types.LinAlgMatrixC4M4N3U1S2, %dx.types.LinAlgMatrixC4M5N3U1S2)"(i32 417,
16+
// CHECK2-SAME: %dx.types.LinAlgMatrixC4M5N3U1S2* {{.*}}, %dx.types.LinAlgMatrixC4M5N4U1S2 %{{[0-9]+}},
17+
// CHECK2-SAME: %dx.types.LinAlgMatrixC4M4N3U1S2 %{{[0-9]+}}, %dx.types.LinAlgMatrixC4M5N3U1S2 %{{[0-9]+}})
918
__builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat1;
10-
__builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat2;
11-
__builtin_LinAlg_MatrixMatrixMultiplyAccumulate(mat2, mat1, mat1, mat1);
19+
__builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 4, 3, 1, 2)]] mat2;
20+
__builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 3, 1, 2)]] mat3;
21+
__builtin_LinAlg_MatrixMatrixMultiplyAccumulate(mat3, mat1, mat2, mat3);
1222
}

0 commit comments

Comments
 (0)