Skip to content

Commit 381156c

Browse files
authored
[HLSL] Update tests to use splat for vector constants (llvm#115198)
Fixes test failures after splat IR printer change: 38fffa6.
1 parent b231647 commit 381156c

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

llvm/test/CodeGen/DirectX/atan2.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ entry:
5656
; Just Expansion, no scalarization or lowering:
5757
; EXPCHECK: [[DIV:%.+]] = fdiv <4 x float> %y, %x
5858
; EXPCHECK: [[ATAN:%.+]] = call <4 x float> @llvm.atan.v4f32(<4 x float> [[DIV]])
59-
; EXPCHECK-DAG: [[ADD_PI:%.+]] = fadd <4 x float> [[ATAN]], <float 0x400921FB60000000, float 0x400921FB60000000, float 0x400921FB60000000, float 0x400921FB60000000>
60-
; EXPCHECK-DAG: [[SUB_PI:%.+]] = fsub <4 x float> [[ATAN]], <float 0x400921FB60000000, float 0x400921FB60000000, float 0x400921FB60000000, float 0x400921FB60000000>
59+
; EXPCHECK-DAG: [[ADD_PI:%.+]] = fadd <4 x float> [[ATAN]], splat (float 0x400921FB60000000)
60+
; EXPCHECK-DAG: [[SUB_PI:%.+]] = fsub <4 x float> [[ATAN]], splat (float 0x400921FB60000000)
6161
; EXPCHECK-DAG: [[X_LT_0:%.+]] = fcmp olt <4 x float> %x, zeroinitializer
6262
; EXPCHECK-DAG: [[X_EQ_0:%.+]] = fcmp oeq <4 x float> %x, zeroinitializer
6363
; EXPCHECK-DAG: [[Y_GE_0:%.+]] = fcmp oge <4 x float> %y, zeroinitializer
@@ -67,9 +67,9 @@ entry:
6767
; EXPCHECK: [[XLT0_AND_YLT0:%.+]] = and <4 x i1> [[X_LT_0]], [[Y_LT_0]]
6868
; EXPCHECK: [[SELECT_SUB_PI:%.+]] = select <4 x i1> [[XLT0_AND_YLT0]], <4 x float> [[SUB_PI]], <4 x float> [[SELECT_ADD_PI]]
6969
; EXPCHECK: [[XEQ0_AND_YLT0:%.+]] = and <4 x i1> [[X_EQ_0]], [[Y_LT_0]]
70-
; EXPCHECK: [[SELECT_NEGHPI:%.+]] = select <4 x i1> [[XEQ0_AND_YLT0]], <4 x float> <float 0xBFF921FB60000000, float 0xBFF921FB60000000, float 0xBFF921FB60000000, float 0xBFF921FB60000000>, <4 x float> [[SELECT_SUB_PI]]
70+
; EXPCHECK: [[SELECT_NEGHPI:%.+]] = select <4 x i1> [[XEQ0_AND_YLT0]], <4 x float> splat (float 0xBFF921FB60000000), <4 x float> [[SELECT_SUB_PI]]
7171
; EXPCHECK: [[XEQ0_AND_YGE0:%.+]] = and <4 x i1> [[X_EQ_0]], [[Y_GE_0]]
72-
; EXPCHECK: [[SELECT_HPI:%.+]] = select <4 x i1> [[XEQ0_AND_YGE0]], <4 x float> <float 0x3FF921FB60000000, float 0x3FF921FB60000000, float 0x3FF921FB60000000, float 0x3FF921FB60000000>, <4 x float> [[SELECT_NEGHPI]]
72+
; EXPCHECK: [[SELECT_HPI:%.+]] = select <4 x i1> [[XEQ0_AND_YGE0]], <4 x float> splat (float 0x3FF921FB60000000), <4 x float> [[SELECT_NEGHPI]]
7373
; EXPCHECK: ret <4 x float> [[SELECT_HPI]]
7474

7575
; Scalarization occurs after expansion, so atan scalarization is tested separately.

llvm/test/CodeGen/DirectX/exp-vec.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
; Make sure dxil operation function calls for exp are generated for float and half.
44

55
; CHECK-LABEL: exp_float4
6-
; CHECK: fmul <4 x float> <float 0x3FF7154760000000, float 0x3FF7154760000000, float 0x3FF7154760000000, float 0x3FF7154760000000>, %{{.*}}
6+
; CHECK: fmul <4 x float> splat (float 0x3FF7154760000000), %{{.*}}
77
; CHECK: call <4 x float> @llvm.exp2.v4f32(<4 x float> %{{.*}})
88
define noundef <4 x float> @exp_float4(<4 x float> noundef %p0) {
99
entry:

llvm/test/CodeGen/DirectX/log-vec.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
; CHECK-LABEL: log_float4
66
; CHECK: call <4 x float> @llvm.log2.v4f32(<4 x float> %{{.*}})
7-
; CHECK: fmul <4 x float> <float 0x3FE62E4300000000, float 0x3FE62E4300000000, float 0x3FE62E4300000000, float 0x3FE62E4300000000>, %{{.*}}
7+
; CHECK: fmul <4 x float> splat (float 0x3FE62E4300000000), %{{.*}}
88
define noundef <4 x float> @log_float4(<4 x float> noundef %p0) {
99
entry:
1010
%p0.addr = alloca <4 x float>, align 16
@@ -16,7 +16,7 @@ entry:
1616

1717
; CHECK-LABEL: log10_float4
1818
; CHECK: call <4 x float> @llvm.log2.v4f32(<4 x float> %{{.*}})
19-
; CHECK: fmul <4 x float> <float 0x3FD3441340000000, float 0x3FD3441340000000, float 0x3FD3441340000000, float 0x3FD3441340000000>, %{{.*}}
19+
; CHECK: fmul <4 x float> splat (float 0x3FD3441340000000), %{{.*}}
2020
define noundef <4 x float> @log10_float4(<4 x float> noundef %p0) {
2121
entry:
2222
%p0.addr = alloca <4 x float>, align 16

llvm/test/CodeGen/DirectX/step.ll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@ entry:
2424
define noundef <2 x half> @test_step_half2(<2 x half> noundef %p0, <2 x half> noundef %p1) {
2525
entry:
2626
; CHECK: %0 = fcmp olt <2 x half> %p1, %p0
27-
; CHECK: %1 = select <2 x i1> %0, <2 x half> zeroinitializer, <2 x half> <half 0xH3C00, half 0xH3C00>
27+
; CHECK: %1 = select <2 x i1> %0, <2 x half> zeroinitializer, <2 x half> splat (half 0xH3C00)
2828
%hlsl.step = call <2 x half> @llvm.dx.step.v2f16(<2 x half> %p0, <2 x half> %p1)
2929
ret <2 x half> %hlsl.step
3030
}
3131

3232
define noundef <3 x half> @test_step_half3(<3 x half> noundef %p0, <3 x half> noundef %p1) {
3333
entry:
3434
; CHECK: %0 = fcmp olt <3 x half> %p1, %p0
35-
; CHECK: %1 = select <3 x i1> %0, <3 x half> zeroinitializer, <3 x half> <half 0xH3C00, half 0xH3C00, half 0xH3C00>
35+
; CHECK: %1 = select <3 x i1> %0, <3 x half> zeroinitializer, <3 x half> splat (half 0xH3C00)
3636
%hlsl.step = call <3 x half> @llvm.dx.step.v3f16(<3 x half> %p0, <3 x half> %p1)
3737
ret <3 x half> %hlsl.step
3838
}
3939

4040
define noundef <4 x half> @test_step_half4(<4 x half> noundef %p0, <4 x half> noundef %p1) {
4141
entry:
4242
; CHECK: %0 = fcmp olt <4 x half> %p1, %p0
43-
; CHECK: %1 = select <4 x i1> %0, <4 x half> zeroinitializer, <4 x half> <half 0xH3C00, half 0xH3C00, half 0xH3C00, half 0xH3C00>
43+
; CHECK: %1 = select <4 x i1> %0, <4 x half> zeroinitializer, <4 x half> splat (half 0xH3C00)
4444
%hlsl.step = call <4 x half> @llvm.dx.step.v4f16(<4 x half> %p0, <4 x half> %p1)
4545
ret <4 x half> %hlsl.step
4646
}
@@ -56,23 +56,23 @@ entry:
5656
define noundef <2 x float> @test_step_float2(<2 x float> noundef %p0, <2 x float> noundef %p1) {
5757
entry:
5858
; CHECK: %0 = fcmp olt <2 x float> %p1, %p0
59-
; CHECK: %1 = select <2 x i1> %0, <2 x float> zeroinitializer, <2 x float> <float 1.000000e+00, float 1.000000e+00>
59+
; CHECK: %1 = select <2 x i1> %0, <2 x float> zeroinitializer, <2 x float> splat (float 1.000000e+00)
6060
%hlsl.step = call <2 x float> @llvm.dx.step.v2f32(<2 x float> %p0, <2 x float> %p1)
6161
ret <2 x float> %hlsl.step
6262
}
6363

6464
define noundef <3 x float> @test_step_float3(<3 x float> noundef %p0, <3 x float> noundef %p1) {
6565
entry:
6666
; CHECK: %0 = fcmp olt <3 x float> %p1, %p0
67-
; CHECK: %1 = select <3 x i1> %0, <3 x float> zeroinitializer, <3 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>
67+
; CHECK: %1 = select <3 x i1> %0, <3 x float> zeroinitializer, <3 x float> splat (float 1.000000e+00)
6868
%hlsl.step = call <3 x float> @llvm.dx.step.v3f32(<3 x float> %p0, <3 x float> %p1)
6969
ret <3 x float> %hlsl.step
7070
}
7171

7272
define noundef <4 x float> @test_step_float4(<4 x float> noundef %p0, <4 x float> noundef %p1) {
7373
entry:
7474
; CHECK: %0 = fcmp olt <4 x float> %p1, %p0
75-
; CHECK: %1 = select <4 x i1> %0, <4 x float> zeroinitializer, <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>
75+
; CHECK: %1 = select <4 x i1> %0, <4 x float> zeroinitializer, <4 x float> splat (float 1.000000e+00)
7676
%hlsl.step = call <4 x float> @llvm.dx.step.v4f32(<4 x float> %p0, <4 x float> %p1)
7777
ret <4 x float> %hlsl.step
7878
}

0 commit comments

Comments
 (0)