Skip to content

Commit 5a8812a

Browse files
author
Greg Roth
authored
Make select_sampler handle different opcodes (microsoft#5631)
The opcode is variable at this stage, so it shouldn't be explicit. This just replaces the CHECK lines with regex for those integers Followon to microsoft#5525
1 parent e10e897 commit 5a8812a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tools/clang/test/CodeGenDXIL/operators/select/select_samplers.hlsl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,23 @@ float4 main(int2 i : I, float4 pos : POS, float cmp :CMP) : SV_Target {
4343
// CHECK-NOT: br
4444
// CHECK: [[gSS1B:%[0-9]*]] = load %struct.SamplerState, %struct.SamplerState* @"\01?gSS1@@3USamplerState@@A"
4545
// CHECK: [[gSS1CHB:%[0-9]*]] = call %dx.types.Handle @"dx.hl.createhandle..%dx.types.Handle (i32, %struct.SamplerState)"(i32 0, %struct.SamplerState [[gSS1B]])
46-
// CHECK: [[gSS1CAB:%[0-9]*]] = call %dx.types.Handle @"dx.hl.annotatehandle..%dx.types.Handle (i32, %dx.types.Handle, %dx.types.ResourceProperties, %struct.SamplerState)"(i32 11, %dx.types.Handle [[gSS1CHB]]
46+
// CHECK: [[gSS1CAB:%[0-9]*]] = call %dx.types.Handle @"dx.hl.annotatehandle..%dx.types.Handle (i32, %dx.types.Handle, %dx.types.ResourceProperties, %struct.SamplerState)"(i32 {{[0-9]*}}, %dx.types.Handle [[gSS1CHB]]
4747

4848
// CHECK: [[gSS2B:%[0-9]*]] = load %struct.SamplerState, %struct.SamplerState* @"\01?gSS2@@3USamplerState@@A"
4949
// CHECK: [[gSS2CHB:%[0-9]*]] = call %dx.types.Handle @"dx.hl.createhandle..%dx.types.Handle (i32, %struct.SamplerState)"(i32 0, %struct.SamplerState [[gSS2B]])
50-
// CHECK: [[gSS2CAB:%[0-9]*]] = call %dx.types.Handle @"dx.hl.annotatehandle..%dx.types.Handle (i32, %dx.types.Handle, %dx.types.ResourceProperties, %struct.SamplerState)"(i32 11, %dx.types.Handle [[gSS2CHB]]
50+
// CHECK: [[gSS2CAB:%[0-9]*]] = call %dx.types.Handle @"dx.hl.annotatehandle..%dx.types.Handle (i32, %dx.types.Handle, %dx.types.ResourceProperties, %struct.SamplerState)"(i32 {{[0-9]*}}, %dx.types.Handle [[gSS2CHB]]
5151

5252
// CHECK: call %dx.types.Handle @"dx.hl.op..%dx.types.Handle (i32, i1, %dx.types.Handle, %dx.types.Handle)"(i32 {{[0-9]*}}, i1 %{{[0-9a-zA-Z_]*}}, %dx.types.Handle [[gSS1CAB]], %dx.types.Handle [[gSS2CAB]])
5353

5454
SamplerState lSS1 = select(getCond(i.x), gSS1, gSS2);
5555

5656
// CHECK: [[gSCS1B:%[0-9]*]] = load %struct.SamplerComparisonState, %struct.SamplerComparisonState* @"\01?gSCS1@@3USamplerComparisonState@@A"
5757
// CHECK: [[gSCS1CHB:%[0-9]*]] = call %dx.types.Handle @"dx.hl.createhandle..%dx.types.Handle (i32, %struct.SamplerComparisonState)"(i32 0, %struct.SamplerComparisonState [[gSCS1B]])
58-
// CHECK: [[gSCS1CAB:%[0-9]*]] = call %dx.types.Handle @"dx.hl.annotatehandle..%dx.types.Handle (i32, %dx.types.Handle, %dx.types.ResourceProperties, %struct.SamplerComparisonState)"(i32 11, %dx.types.Handle [[gSCS1CHB]]
58+
// CHECK: [[gSCS1CAB:%[0-9]*]] = call %dx.types.Handle @"dx.hl.annotatehandle..%dx.types.Handle (i32, %dx.types.Handle, %dx.types.ResourceProperties, %struct.SamplerComparisonState)"(i32 {{[0-9]*}}, %dx.types.Handle [[gSCS1CHB]]
5959

6060
// CHECK: [[gSCS2B:%[0-9]*]] = load %struct.SamplerComparisonState, %struct.SamplerComparisonState* @"\01?gSCS2@@3USamplerComparisonState@@A"
6161
// CHECK: [[gSCS2CHB:%[0-9]*]] = call %dx.types.Handle @"dx.hl.createhandle..%dx.types.Handle (i32, %struct.SamplerComparisonState)"(i32 0, %struct.SamplerComparisonState [[gSCS2B]])
62-
// CHECK: [[gSCS2CAB:%[0-9]*]] = call %dx.types.Handle @"dx.hl.annotatehandle..%dx.types.Handle (i32, %dx.types.Handle, %dx.types.ResourceProperties, %struct.SamplerComparisonState)"(i32 11, %dx.types.Handle [[gSCS2CHB]]
62+
// CHECK: [[gSCS2CAB:%[0-9]*]] = call %dx.types.Handle @"dx.hl.annotatehandle..%dx.types.Handle (i32, %dx.types.Handle, %dx.types.ResourceProperties, %struct.SamplerComparisonState)"(i32 {{[0-9]*}}, %dx.types.Handle [[gSCS2CHB]]
6363

6464
// CHECK: call %dx.types.Handle @"dx.hl.op..%dx.types.Handle (i32, i1, %dx.types.Handle, %dx.types.Handle)"(i32 {{[0-9]*}}, i1 %{{[0-9a-zA-Z_]*}}, %dx.types.Handle [[gSCS1CAB]], %dx.types.Handle [[gSCS2CAB]])
6565

@@ -91,23 +91,23 @@ float4 main(int2 i : I, float4 pos : POS, float cmp :CMP) : SV_Target {
9191
// CHECK-NOT: br
9292
// CHECK: [[gSS2D:%[0-9]*]] = load %struct.SamplerState, %struct.SamplerState* @"\01?gSS2@@3USamplerState@@A"
9393
// CHECK: [[gSS2CHD:%[0-9]*]] = call %dx.types.Handle @"dx.hl.createhandle..%dx.types.Handle (i32, %struct.SamplerState)"(i32 0, %struct.SamplerState [[gSS2D]])
94-
// CHECK: [[gSS2CAD:%[0-9]*]] = call %dx.types.Handle @"dx.hl.annotatehandle..%dx.types.Handle (i32, %dx.types.Handle, %dx.types.ResourceProperties, %struct.SamplerState)"(i32 11, %dx.types.Handle [[gSS2CHD]]
94+
// CHECK: [[gSS2CAD:%[0-9]*]] = call %dx.types.Handle @"dx.hl.annotatehandle..%dx.types.Handle (i32, %dx.types.Handle, %dx.types.ResourceProperties, %struct.SamplerState)"(i32 {{[0-9]*}}, %dx.types.Handle [[gSS2CHD]]
9595

9696
// CHECK: [[lSS0D:%[0-9]*]] = load %struct.SamplerState, %struct.SamplerState* %lSS1
9797
// CHECK: [[lSS0CHD:%[0-9]*]] = call %dx.types.Handle @"dx.hl.createhandle..%dx.types.Handle (i32, %struct.SamplerState)"(i32 0, %struct.SamplerState [[lSS0D]])
98-
// CHECK: [[lSS0CAD:%[0-9]*]] = call %dx.types.Handle @"dx.hl.annotatehandle..%dx.types.Handle (i32, %dx.types.Handle, %dx.types.ResourceProperties, %struct.SamplerState)"(i32 11, %dx.types.Handle [[lSS0CHD]]
98+
// CHECK: [[lSS0CAD:%[0-9]*]] = call %dx.types.Handle @"dx.hl.annotatehandle..%dx.types.Handle (i32, %dx.types.Handle, %dx.types.ResourceProperties, %struct.SamplerState)"(i32 {{[0-9]*}}, %dx.types.Handle [[lSS0CHD]]
9999

100100
// CHECK: call %dx.types.Handle @"dx.hl.op..%dx.types.Handle (i32, i1, %dx.types.Handle, %dx.types.Handle)"(i32 {{[0-9]*}}, i1 %{{[0-9a-zA-Z_]*}}, %dx.types.Handle [[gSS2CAD]], %dx.types.Handle [[lSS0CAD]])
101101

102102
lSS1 = select(getCond(i.y), gSS2, lSS1);
103103

104104
// CHECK: [[gSCS2D:%[0-9]*]] = load %struct.SamplerComparisonState, %struct.SamplerComparisonState* @"\01?gSCS2@@3USamplerComparisonState@@A"
105105
// CHECK: [[gSCS2CHD:%[0-9]*]] = call %dx.types.Handle @"dx.hl.createhandle..%dx.types.Handle (i32, %struct.SamplerComparisonState)"(i32 0, %struct.SamplerComparisonState [[gSCS2D]])
106-
// CHECK: [[gSCS2CAD:%[0-9]*]] = call %dx.types.Handle @"dx.hl.annotatehandle..%dx.types.Handle (i32, %dx.types.Handle, %dx.types.ResourceProperties, %struct.SamplerComparisonState)"(i32 11, %dx.types.Handle [[gSCS2CHD]]
106+
// CHECK: [[gSCS2CAD:%[0-9]*]] = call %dx.types.Handle @"dx.hl.annotatehandle..%dx.types.Handle (i32, %dx.types.Handle, %dx.types.ResourceProperties, %struct.SamplerComparisonState)"(i32 {{[0-9]*}}, %dx.types.Handle [[gSCS2CHD]]
107107

108108
// CHECK: [[lSCS0D:%[0-9]*]] = load %struct.SamplerComparisonState, %struct.SamplerComparisonState* %lSCS1
109109
// CHECK: [[lSCS0CHD:%[0-9]*]] = call %dx.types.Handle @"dx.hl.createhandle..%dx.types.Handle (i32, %struct.SamplerComparisonState)"(i32 0, %struct.SamplerComparisonState [[lSCS0D]])
110-
// CHECK: [[lSCS0CAD:%[0-9]*]] = call %dx.types.Handle @"dx.hl.annotatehandle..%dx.types.Handle (i32, %dx.types.Handle, %dx.types.ResourceProperties, %struct.SamplerComparisonState)"(i32 11, %dx.types.Handle [[lSCS0CHD]]
110+
// CHECK: [[lSCS0CAD:%[0-9]*]] = call %dx.types.Handle @"dx.hl.annotatehandle..%dx.types.Handle (i32, %dx.types.Handle, %dx.types.ResourceProperties, %struct.SamplerComparisonState)"(i32 {{[0-9]*}}, %dx.types.Handle [[lSCS0CHD]]
111111

112112
// CHECK: call %dx.types.Handle @"dx.hl.op..%dx.types.Handle (i32, i1, %dx.types.Handle, %dx.types.Handle)"(i32 {{[0-9]*}}, i1 %{{[0-9a-zA-Z_]*}}, %dx.types.Handle [[gSCS2CAD]], %dx.types.Handle [[lSCS0CAD]])
113113
lSCS1 = select(getCond(i.y), gSCS2, lSCS1);

0 commit comments

Comments
 (0)