Skip to content

Commit 6fce77a

Browse files
committed
Drop vector operation expansion of saturate as it is expected to
be handled in a scalarization pass planned to be implemented in the future. Remove saturate tests with vector operands.
1 parent 8082482 commit 6fce77a

File tree

2 files changed

+0
-208
lines changed

2 files changed

+0
-208
lines changed

llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ static bool isIntrinsicExpansion(Function &F) {
4747
case Intrinsic::dx_normalize:
4848
case Intrinsic::dx_sdot:
4949
case Intrinsic::dx_udot:
50-
case Intrinsic::dx_saturate:
5150
return true;
5251
}
5352
return false;

llvm/test/CodeGen/DirectX/saturate.ll

Lines changed: 0 additions & 207 deletions
Original file line numberDiff line numberDiff line change
@@ -19,75 +19,6 @@ entry:
1919
; Function Attrs: nocallback nofree nosync nounwind willreturn
2020
declare half @llvm.dx.saturate.f16(half) #1
2121

22-
; CHECK-LABEL: test_saturate_half2
23-
define noundef <2 x half> @test_saturate_half2(<2 x half> noundef %p0) #0 {
24-
entry:
25-
%p0.addr = alloca <2 x half>, align 4
26-
store <2 x half> %p0, ptr %p0.addr, align 4, !tbaa !8
27-
%0 = load <2 x half>, ptr %p0.addr, align 4, !tbaa !8
28-
; CHECK: %1 = extractelement <2 x half> %0, i64 0
29-
; CHECK-NEXT: %2 = call half @dx.op.unary.f16(i32 7, half %1)
30-
; CHECK-NEXT: %3 = insertelement <2 x half> %0, half %2, i64 0
31-
; CHECK-NEXT: %4 = extractelement <2 x half> %0, i64 1
32-
; CHECK-NEXT: %5 = call half @dx.op.unary.f16(i32 7, half %4)
33-
; CHECK-NEXT: %6 = insertelement <2 x half> %0, half %5, i64 1
34-
%hlsl.saturate = call <2 x half> @llvm.dx.saturate.v2f16(<2 x half> %0)
35-
; CHECK: ret <2 x half> %6
36-
ret <2 x half> %hlsl.saturate
37-
}
38-
39-
; Function Attrs: nocallback nofree nosync nounwind willreturn
40-
declare <2 x half> @llvm.dx.saturate.v2f16(<2 x half>) #1
41-
42-
; CHECK-LABEL: test_saturate_half3
43-
define noundef <3 x half> @test_saturate_half3(<3 x half> noundef %p0) #0 {
44-
entry:
45-
%p0.addr = alloca <3 x half>, align 8
46-
store <3 x half> %p0, ptr %p0.addr, align 8, !tbaa !8
47-
%0 = load <3 x half>, ptr %p0.addr, align 8, !tbaa !8
48-
; CHECK: %1 = extractelement <3 x half> %0, i64 0
49-
; CHECK-NEXT: %2 = call half @dx.op.unary.f16(i32 7, half %1)
50-
; CHECK-NEXT: %3 = insertelement <3 x half> %0, half %2, i64 0
51-
; CHECK-NEXT: %4 = extractelement <3 x half> %0, i64 1
52-
; CHECK-NEXT: %5 = call half @dx.op.unary.f16(i32 7, half %4)
53-
; CHECK-NEXT: %6 = insertelement <3 x half> %0, half %5, i64 1
54-
; CHECK-NEXT: %7 = extractelement <3 x half> %0, i64 2
55-
; CHECK-NEXT: %8 = call half @dx.op.unary.f16(i32 7, half %7)
56-
; CHECK-NEXT: %9 = insertelement <3 x half> %0, half %8, i64 2
57-
%hlsl.saturate = call <3 x half> @llvm.dx.saturate.v3f16(<3 x half> %0)
58-
; CHECK: ret <3 x half> %9
59-
ret <3 x half> %hlsl.saturate
60-
}
61-
62-
; Function Attrs: nocallback nofree nosync nounwind willreturn
63-
declare <3 x half> @llvm.dx.saturate.v3f16(<3 x half>) #1
64-
65-
; CHECK-LABEL: test_saturate_half4
66-
define noundef <4 x half> @test_saturate_half4(<4 x half> noundef %p0) #0 {
67-
entry:
68-
%p0.addr = alloca <4 x half>, align 8
69-
store <4 x half> %p0, ptr %p0.addr, align 8, !tbaa !8
70-
%0 = load <4 x half>, ptr %p0.addr, align 8, !tbaa !8
71-
; CHECK: %1 = extractelement <4 x half> %0, i64 0
72-
; CHECK-NEXT: %2 = call half @dx.op.unary.f16(i32 7, half %1)
73-
; CHECK-NEXT: %3 = insertelement <4 x half> %0, half %2, i64 0
74-
; CHECK-NEXT: %4 = extractelement <4 x half> %0, i64 1
75-
; CHECK-NEXT: %5 = call half @dx.op.unary.f16(i32 7, half %4)
76-
; CHECK-NEXT: %6 = insertelement <4 x half> %0, half %5, i64 1
77-
; CHECK-NEXT: %7 = extractelement <4 x half> %0, i64 2
78-
; CHECK-NEXT: %8 = call half @dx.op.unary.f16(i32 7, half %7)
79-
; CHECK-NEXT: %9 = insertelement <4 x half> %0, half %8, i64 2
80-
; CHECK-NEXT: %10 = extractelement <4 x half> %0, i64 3
81-
; CHECK-NEXT: %11 = call half @dx.op.unary.f16(i32 7, half %10)
82-
; CHECK-NEXT: %12 = insertelement <4 x half> %0, half %11, i64 3
83-
%hlsl.saturate = call <4 x half> @llvm.dx.saturate.v4f16(<4 x half> %0)
84-
; CHECK: ret <4 x half> %12
85-
ret <4 x half> %hlsl.saturate
86-
}
87-
88-
; Function Attrs: nocallback nofree nosync nounwind willreturn
89-
declare <4 x half> @llvm.dx.saturate.v4f16(<4 x half>) #1
90-
9122
; CHECK-LABEL: test_saturate_float
9223
define noundef float @test_saturate_float(float noundef %p0) #0 {
9324
entry:
@@ -103,75 +34,6 @@ entry:
10334
; Function Attrs: nocallback nofree nosync nounwind willreturn
10435
declare float @llvm.dx.saturate.f32(float) #1
10536

106-
; CHECK-LABEL: test_saturate_float2
107-
define noundef <2 x float> @test_saturate_float2(<2 x float> noundef %p0) #0 {
108-
entry:
109-
%p0.addr = alloca <2 x float>, align 8
110-
store <2 x float> %p0, ptr %p0.addr, align 8, !tbaa !8
111-
%0 = load <2 x float>, ptr %p0.addr, align 8, !tbaa !8
112-
; CHECK: %1 = extractelement <2 x float> %0, i64 0
113-
; CHECK-NEXT: %2 = call float @dx.op.unary.f32(i32 7, float %1)
114-
; CHECK-NEXT: %3 = insertelement <2 x float> %0, float %2, i64 0
115-
; CHECK-NEXT: %4 = extractelement <2 x float> %0, i64 1
116-
; CHECK-NEXT: %5 = call float @dx.op.unary.f32(i32 7, float %4)
117-
; CHECK-NEXT: %6 = insertelement <2 x float> %0, float %5, i64 1
118-
%hlsl.saturate = call <2 x float> @llvm.dx.saturate.v2f32(<2 x float> %0)
119-
; CHECK: ret <2 x float> %6
120-
ret <2 x float> %hlsl.saturate
121-
}
122-
123-
; Function Attrs: nocallback nofree nosync nounwind willreturn
124-
declare <2 x float> @llvm.dx.saturate.v2f32(<2 x float>) #1
125-
126-
; CHECK-LABEL: test_saturate_float3
127-
define noundef <3 x float> @test_saturate_float3(<3 x float> noundef %p0) #0 {
128-
entry:
129-
%p0.addr = alloca <3 x float>, align 16
130-
store <3 x float> %p0, ptr %p0.addr, align 16, !tbaa !8
131-
%0 = load <3 x float>, ptr %p0.addr, align 16, !tbaa !8
132-
; CHECK: %1 = extractelement <3 x float> %0, i64 0
133-
; CHECK-NEXT: %2 = call float @dx.op.unary.f32(i32 7, float %1)
134-
; CHECK-NEXT: %3 = insertelement <3 x float> %0, float %2, i64 0
135-
; CHECK-NEXT: %4 = extractelement <3 x float> %0, i64 1
136-
; CHECK-NEXT: %5 = call float @dx.op.unary.f32(i32 7, float %4)
137-
; CHECK-NEXT: %6 = insertelement <3 x float> %0, float %5, i64 1
138-
; CHECK-NEXT: %7 = extractelement <3 x float> %0, i64 2
139-
; CHECK-NEXT: %8 = call float @dx.op.unary.f32(i32 7, float %7)
140-
; CHECK-NEXT: %9 = insertelement <3 x float> %0, float %8, i64 2
141-
%hlsl.saturate = call <3 x float> @llvm.dx.saturate.v3f32(<3 x float> %0)
142-
; CHECK: ret <3 x float> %9
143-
ret <3 x float> %hlsl.saturate
144-
}
145-
146-
; Function Attrs: nocallback nofree nosync nounwind willreturn
147-
declare <3 x float> @llvm.dx.saturate.v3f32(<3 x float>) #1
148-
149-
; CHECK-LABEL: test_saturate_float4
150-
define noundef <4 x float> @test_saturate_float4(<4 x float> noundef %p0) #0 {
151-
entry:
152-
%p0.addr = alloca <4 x float>, align 16
153-
store <4 x float> %p0, ptr %p0.addr, align 16, !tbaa !8
154-
%0 = load <4 x float>, ptr %p0.addr, align 16, !tbaa !8
155-
; CHECK: %1 = extractelement <4 x float> %0, i64 0
156-
; CHECK-NEXT: %2 = call float @dx.op.unary.f32(i32 7, float %1)
157-
; CHECK-NEXT: %3 = insertelement <4 x float> %0, float %2, i64 0
158-
; CHECK-NEXT: %4 = extractelement <4 x float> %0, i64 1
159-
; CHECK-NEXT: %5 = call float @dx.op.unary.f32(i32 7, float %4)
160-
; CHECK-NEXT: %6 = insertelement <4 x float> %0, float %5, i64 1
161-
; CHECK-NEXT: %7 = extractelement <4 x float> %0, i64 2
162-
; CHECK-NEXT: %8 = call float @dx.op.unary.f32(i32 7, float %7)
163-
; CHECK-NEXT: %9 = insertelement <4 x float> %0, float %8, i64 2
164-
; CHECK-NEXT: %10 = extractelement <4 x float> %0, i64 3
165-
; CHECK-NEXT: %11 = call float @dx.op.unary.f32(i32 7, float %10)
166-
; CHECK-NEXT: %12 = insertelement <4 x float> %0, float %11, i64 3
167-
%hlsl.saturate = call <4 x float> @llvm.dx.saturate.v4f32(<4 x float> %0)
168-
; CHECK: ret <4 x float> %12
169-
ret <4 x float> %hlsl.saturate
170-
}
171-
172-
; Function Attrs: nocallback nofree nosync nounwind willreturn
173-
declare <4 x float> @llvm.dx.saturate.v4f32(<4 x float>) #1
174-
17537
; CHECK-LABEL: test_saturate_double
17638
define noundef double @test_saturate_double(double noundef %p0) #0 {
17739
entry:
@@ -187,75 +49,6 @@ entry:
18749
; Function Attrs: nocallback nofree nosync nounwind willreturn
18850
declare double @llvm.dx.saturate.f64(double) #1
18951

190-
; CHECK-LABEL: test_saturate_double2
191-
define noundef <2 x double> @test_saturate_double2(<2 x double> noundef %p0) #0 {
192-
entry:
193-
%p0.addr = alloca <2 x double>, align 16
194-
store <2 x double> %p0, ptr %p0.addr, align 16, !tbaa !8
195-
%0 = load <2 x double>, ptr %p0.addr, align 16, !tbaa !8
196-
; CHECK: %1 = extractelement <2 x double> %0, i64 0
197-
; CHECK-NEXT: %2 = call double @dx.op.unary.f64(i32 7, double %1)
198-
; CHECK-NEXT: %3 = insertelement <2 x double> %0, double %2, i64 0
199-
; CHECK-NEXT: %4 = extractelement <2 x double> %0, i64 1
200-
; CHECK-NEXT: %5 = call double @dx.op.unary.f64(i32 7, double %4)
201-
; CHECK-NEXT: %6 = insertelement <2 x double> %0, double %5, i64 1
202-
%hlsl.saturate = call <2 x double> @llvm.dx.saturate.v2f64(<2 x double> %0)
203-
; CHECK: ret <2 x double> %6
204-
ret <2 x double> %hlsl.saturate
205-
}
206-
207-
; Function Attrs: nocallback nofree nosync nounwind willreturn
208-
declare <2 x double> @llvm.dx.saturate.v2f64(<2 x double>) #1
209-
210-
; CHECK-LABEL: test_saturate_double3
211-
define noundef <3 x double> @test_saturate_double3(<3 x double> noundef %p0) #0 {
212-
entry:
213-
%p0.addr = alloca <3 x double>, align 32
214-
store <3 x double> %p0, ptr %p0.addr, align 32, !tbaa !8
215-
%0 = load <3 x double>, ptr %p0.addr, align 32, !tbaa !8
216-
; CHECK: %1 = extractelement <3 x double> %0, i64 0
217-
; CHECK-NEXT: %2 = call double @dx.op.unary.f64(i32 7, double %1)
218-
; CHECK-NEXT: %3 = insertelement <3 x double> %0, double %2, i64 0
219-
; CHECK-NEXT: %4 = extractelement <3 x double> %0, i64 1
220-
; CHECK-NEXT: %5 = call double @dx.op.unary.f64(i32 7, double %4)
221-
; CHECK-NEXT: %6 = insertelement <3 x double> %0, double %5, i64 1
222-
; CHECK-NEXT: %7 = extractelement <3 x double> %0, i64 2
223-
; CHECK-NEXT: %8 = call double @dx.op.unary.f64(i32 7, double %7)
224-
; CHECK-NEXT: %9 = insertelement <3 x double> %0, double %8, i64 2
225-
%hlsl.saturate = call <3 x double> @llvm.dx.saturate.v3f64(<3 x double> %0)
226-
; CHECK: ret <3 x double> %9
227-
ret <3 x double> %hlsl.saturate
228-
}
229-
230-
; Function Attrs: nocallback nofree nosync nounwind willreturn
231-
declare <3 x double> @llvm.dx.saturate.v3f64(<3 x double>) #1
232-
233-
; CHECK-LABEL: test_saturate_double4
234-
define noundef <4 x double> @test_saturate_double4(<4 x double> noundef %p0) #0 {
235-
entry:
236-
%p0.addr = alloca <4 x double>, align 32
237-
store <4 x double> %p0, ptr %p0.addr, align 32, !tbaa !8
238-
%0 = load <4 x double>, ptr %p0.addr, align 32, !tbaa !8
239-
; CHECK: %1 = extractelement <4 x double> %0, i64 0
240-
; CHECK-NEXT: %2 = call double @dx.op.unary.f64(i32 7, double %1)
241-
; CHECK-NEXT: %3 = insertelement <4 x double> %0, double %2, i64 0
242-
; CHECK-NEXT: %4 = extractelement <4 x double> %0, i64 1
243-
; CHECK-NEXT: %5 = call double @dx.op.unary.f64(i32 7, double %4)
244-
; CHECK-NEXT: %6 = insertelement <4 x double> %0, double %5, i64 1
245-
; CHECK-NEXT: %7 = extractelement <4 x double> %0, i64 2
246-
; CHECK-NEXT: %8 = call double @dx.op.unary.f64(i32 7, double %7)
247-
; CHECK-NEXT: %9 = insertelement <4 x double> %0, double %8, i64 2
248-
; CHECK-NEXT: %10 = extractelement <4 x double> %0, i64 3
249-
; CHECK-NEXT: %11 = call double @dx.op.unary.f64(i32 7, double %10)
250-
; CHECK-NEXT: %12 = insertelement <4 x double> %0, double %11, i64 3
251-
%hlsl.saturate = call <4 x double> @llvm.dx.saturate.v4f64(<4 x double> %0)
252-
; CHECK: ret <4 x double> %12
253-
ret <4 x double> %hlsl.saturate
254-
}
255-
256-
; Function Attrs: nocallback nofree nosync nounwind willreturn
257-
declare <4 x double> @llvm.dx.saturate.v4f64(<4 x double>) #1
258-
25952
attributes #0 = { convergent nounwind "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
26053
attributes #1 = { nocallback nofree nosync nounwind willreturn }
26154

0 commit comments

Comments
 (0)