Skip to content

Commit 54c21f7

Browse files
authored
[SM6.10] Add -fcgl variant to LinAlg Matrix codegen tests (microsoft#8262)
Adds -`fcgl` variant to existing LinAlg Matrix codegen tests. Check lines edited into multiple line for better readability. Part of microsoft#8211
1 parent 21f060b commit 54c21f7

19 files changed

Lines changed: 160 additions & 25 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: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
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.linAlgFillMatrix.mC4M5N4U1S2.i32(i32 -2147483636, i32 {{.*}}) ; LinAlgFillMatrix(value)
9+
// CHECK: %{{.*}} = call %dx.types.LinAlgMatrixC4M5N4U1S2 @dx.op.linAlgFillMatrix.mC4M5N4U1S2.i32
10+
// CHECK-SAME: (i32 -2147483636, i32 {{.*}}) ; LinAlgFillMatrix(value)
11+
12+
// CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC4M5N4U1S2*, i32)"
13+
// CHECK2-SAME: (i32 406, %dx.types.LinAlgMatrixC4M5N4U1S2* {{.*}}, i32 5),
914
__builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat1;
1015
__builtin_LinAlg_FillMatrix(mat1, 5);
11-
// CHECK: %{{.*}} = call %dx.types.LinAlgMatrixC5M3N4U0S0 @dx.op.linAlgFillMatrix.mC5M3N4U0S0.f32(i32 -2147483636, float {{.*}}) ; LinAlgFillMatrix(value)
16+
17+
// CHECK: %{{.*}} = call %dx.types.LinAlgMatrixC5M3N4U0S0 @dx.op.linAlgFillMatrix.mC5M3N4U0S0.f32
18+
// CHECK-SAME: (i32 -2147483636, float {{.*}}) ; LinAlgFillMatrix(value)
19+
20+
// CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC5M3N4U0S0*, float)"
21+
// CHECK2-SAME: (i32 406, %dx.types.LinAlgMatrixC5M3N4U0S0* {{.*}}, float 0x40091EB860000000)
1222
__builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(5, 3, 4, 0, 0)]] mat2;
1323
__builtin_LinAlg_FillMatrix(mat2, 3.14);
1424
}
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-SAME: %dx.types.LinAlgMatrixC5M3N4U0S0)"(i32 415, %dx.types.LinAlgMatrixC2M2N2U2S2* %mat3,
18+
// CHECK2-SAME: %dx.types.LinAlgMatrixC1M1N1U0S0 %{{[0-9]+}}, %dx.types.LinAlgMatrixC5M3N4U0S0 %{{[0-9]+}})
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 {{.*}}, %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: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
// REQUIRES: dxil-1-10
22
// RUN: %dxc -T cs_6_10 -HV 202x -E main %s | FileCheck %s
3+
// RUN: %dxc -T cs_6_10 -HV 202x -E main -fcgl %s | FileCheck %s --check-prefix=CHECK2
34

4-
// CHECK: @{{.*}} = external addrspace(3) global [64 x float]
5+
// CHECK: @"\01?SharedArr@@3PAMA" = external addrspace(3) global [64 x float], align 4
56
groupshared float SharedArr[64];
67

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

11-
// CHECK: call void @dx.op.linAlgMatrixAccumulateToMemory.mC4M5N4U1S2.f32(i32 -2147483620, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, float addrspace(3)* getelementptr {{.*}}, i32 1, i32 2, i32 3) ; LinAlgMatrixAccumulateToMemory(matrix,memory,offset,stride,layout)
12+
// CHECK: call void @dx.op.linAlgMatrixAccumulateToMemory.mC4M5N4U1S2.f32(i32 -2147483620,
13+
// CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, float addrspace(3)* getelementptr inbounds ([64 x float],
14+
// CHECK-SAME: [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 1, i32 2, i32 3)
15+
// CHECK-SAME: ; LinAlgMatrixAccumulateToMemory(matrix,memory,offset,stride,layout)
16+
17+
// CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC4M5N4U1S2,
18+
// CHECK2-SAME: [64 x float] addrspace(3)*, i32, i32, i32)"(i32 420,
19+
// CHECK2-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA",
20+
// CHECK2-SAME: i32 1, i32 2, i32 3)
1221
__builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat;
1322
__builtin_LinAlg_MatrixAccumulateToMemory(mat, SharedArr, 1, 2, 3);
1423
}
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 {{.*}}, 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
}
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
// REQUIRES: dxil-1-10
22
// RUN: %dxc -T cs_6_10 -HV 202x -E main %s | FileCheck %s
3+
// RUN: %dxc -T cs_6_10 -HV 202x -E main -fcgl %s | FileCheck %s --check-prefix=CHECK2
34

4-
// CHECK: @{{.*}} = external addrspace(3) global [64 x float]
5+
// CHECK: @"\01?SharedArr@@3PAMA" = external addrspace(3) global [64 x float], align 4
56
groupshared float SharedArr[64];
67

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

11-
// CHECK: call %dx.types.LinAlgMatrixC4M5N4U1S2 @dx.op.linAlgMatrixLoadFromMemory.mC4M5N4U1S2.f32(i32 -2147483633, float addrspace(3)* getelementptr {{.*}}, i32 1, i32 2, i32 3) ; LinAlgMatrixLoadFromMemory(memory,offset,stride,layout)
12+
// CHECK: call %dx.types.LinAlgMatrixC4M5N4U1S2 @dx.op.linAlgMatrixLoadFromMemory.mC4M5N4U1S2.f32
13+
// CHECK-SAME; (i32 -2147483633, float addrspace(3)* getelementptr inbounds ([64 x float],
14+
// CHECK-SAME: [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 1, i32 2, i32 3)
15+
// CHECK-SAME: ; LinAlgMatrixLoadFromMemory(memory,offset,stride,layout)
16+
17+
// CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC4M5N4U1S2*, [64 x float] addrspace(3)*,
18+
// CHECK2-SAME: i32, i32, i32)"(i32 411, %dx.types.LinAlgMatrixC4M5N4U1S2* %mat, [64 x float] addrspace(3)*
19+
// CHECK2-SAME: @"\01?SharedArr@@3PAMA", i32 1, i32 2, i32 3)
1220
__builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat;
1321
__builtin_LinAlg_MatrixLoadFromMemory(mat, SharedArr, 1, 2, 3);
1422
}

0 commit comments

Comments
 (0)