@@ -89,6 +89,14 @@ declare half @llvm.amdgcn.sqrt.f16(half) nounwind readnone
89
89
declare float @llvm.amdgcn.sqrt.f32 (float ) nounwind readnone
90
90
declare double @llvm.amdgcn.sqrt.f64 (double ) nounwind readnone
91
91
92
+ define half @test_constant_fold_sqrt_f16_poison () nounwind {
93
+ ; CHECK-LABEL: @test_constant_fold_sqrt_f16_poison(
94
+ ; CHECK-NEXT: ret half poison
95
+ ;
96
+ %val = call half @llvm.amdgcn.sqrt.f16 (half poison) nounwind readnone
97
+ ret half %val
98
+ }
99
+
92
100
define half @test_constant_fold_sqrt_f16_undef () nounwind {
93
101
; CHECK-LABEL: @test_constant_fold_sqrt_f16_undef(
94
102
; CHECK-NEXT: ret half 0xH7E00
@@ -97,6 +105,14 @@ define half @test_constant_fold_sqrt_f16_undef() nounwind {
97
105
ret half %val
98
106
}
99
107
108
+ define float @test_constant_fold_sqrt_f32_poison () nounwind {
109
+ ; CHECK-LABEL: @test_constant_fold_sqrt_f32_poison(
110
+ ; CHECK-NEXT: ret float poison
111
+ ;
112
+ %val = call float @llvm.amdgcn.sqrt.f32 (float poison) nounwind readnone
113
+ ret float %val
114
+ }
115
+
100
116
define float @test_constant_fold_sqrt_f32_undef () nounwind {
101
117
; CHECK-LABEL: @test_constant_fold_sqrt_f32_undef(
102
118
; CHECK-NEXT: ret float 0x7FF8000000000000
@@ -234,6 +250,14 @@ define double @test_amdgcn_sqrt_f64(double %arg) {
234
250
235
251
declare float @llvm.amdgcn.rsq.f32 (float ) nounwind readnone
236
252
253
+ define float @test_constant_fold_rsq_f32_poison () nounwind {
254
+ ; CHECK-LABEL: @test_constant_fold_rsq_f32_poison(
255
+ ; CHECK-NEXT: ret float poison
256
+ ;
257
+ %val = call float @llvm.amdgcn.rsq.f32 (float poison) nounwind readnone
258
+ ret float %val
259
+ }
260
+
237
261
define float @test_constant_fold_rsq_f32_undef () nounwind {
238
262
; CHECK-LABEL: @test_constant_fold_rsq_f32_undef(
239
263
; CHECK-NEXT: ret float 0x7FF8000000000000
0 commit comments