1
+ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
1
2
; RUN: opt < %s -dce -S | FileCheck %s
2
3
; RUN: opt < %s -passes=dce -S | FileCheck %s
3
4
4
- declare double @acos (double ) nounwind
5
- declare double @asin (double ) nounwind
6
- declare double @atan (double ) nounwind
7
- declare double @atan2 (double , double ) nounwind
8
- declare double @ceil (double ) nounwind
9
- declare double @cos (double ) nounwind
10
- declare double @cosh (double ) nounwind
11
- declare double @exp (double ) nounwind
12
- declare double @exp2 (double ) nounwind
13
- declare double @fabs (double ) nounwind
14
- declare double @floor (double ) nounwind
15
- declare double @fmod (double , double ) nounwind
16
- declare double @log (double ) nounwind
17
- declare double @log10 (double ) nounwind
18
- declare double @pow (double , double ) nounwind
19
- declare double @sin (double ) nounwind
20
- declare double @sinh (double ) nounwind
21
- declare double @sqrt (double ) nounwind
22
- declare double @tan (double ) nounwind
23
- declare double @tanh (double ) nounwind
24
-
25
- declare float @acosf (float ) nounwind
26
- declare float @asinf (float ) nounwind
27
- declare float @atanf (float ) nounwind
28
- declare float @atan2f (float , float ) nounwind
29
- declare float @ceilf (float ) nounwind
30
- declare float @cosf (float ) nounwind
31
- declare float @coshf (float ) nounwind
32
- declare float @expf (float ) nounwind
33
- declare float @exp2f (float ) nounwind
34
- declare float @fabsf (float ) nounwind
35
- declare float @floorf (float ) nounwind
36
- declare float @fmodf (float , float ) nounwind
37
- declare float @logf (float ) nounwind
38
- declare float @log10f (float ) nounwind
39
- declare float @powf (float , float ) nounwind
40
- declare float @sinf (float ) nounwind
41
- declare float @sinhf (float ) nounwind
42
- declare float @sqrtf (float ) nounwind
43
- declare float @tanf (float ) nounwind
44
- declare float @tanhf (float ) nounwind
5
+ declare double @acos (double ) nounwind willreturn
6
+ declare double @asin (double ) nounwind willreturn
7
+ declare double @atan (double ) nounwind willreturn
8
+ declare double @atan2 (double , double ) nounwind willreturn
9
+ declare double @ceil (double ) nounwind willreturn
10
+ declare double @cos (double ) nounwind willreturn
11
+ declare double @cosh (double ) nounwind willreturn
12
+ declare double @exp (double ) nounwind willreturn
13
+ declare double @exp2 (double ) nounwind willreturn
14
+ declare double @fabs (double ) nounwind willreturn
15
+ declare double @floor (double ) nounwind willreturn
16
+ declare double @fmod (double , double ) nounwind willreturn
17
+ declare double @log (double ) nounwind willreturn
18
+ declare double @log10 (double ) nounwind willreturn
19
+ declare double @pow (double , double ) nounwind willreturn
20
+ declare double @sin (double ) nounwind willreturn
21
+ declare double @sinh (double ) nounwind willreturn
22
+ declare double @sqrt (double ) nounwind willreturn
23
+ declare double @tan (double ) nounwind willreturn
24
+ declare double @tanh (double ) nounwind willreturn
25
+
26
+ declare float @acosf (float ) nounwind willreturn
27
+ declare float @asinf (float ) nounwind willreturn
28
+ declare float @atanf (float ) nounwind willreturn
29
+ declare float @atan2f (float , float ) nounwind willreturn
30
+ declare float @ceilf (float ) nounwind willreturn
31
+ declare float @cosf (float ) nounwind willreturn
32
+ declare float @coshf (float ) nounwind willreturn
33
+ declare float @expf (float ) nounwind willreturn
34
+ declare float @exp2f (float ) nounwind willreturn
35
+ declare float @fabsf (float ) nounwind willreturn
36
+ declare float @floorf (float ) nounwind willreturn
37
+ declare float @fmodf (float , float ) nounwind willreturn
38
+ declare float @logf (float ) nounwind willreturn
39
+ declare float @log10f (float ) nounwind willreturn willreturn
40
+ declare float @powf (float , float ) nounwind willreturn
41
+ declare float @sinf (float ) nounwind willreturn
42
+ declare float @sinhf (float ) nounwind willreturn
43
+ declare float @sqrtf (float ) nounwind willreturn
44
+ declare float @tanf (float ) nounwind willreturn
45
+ declare float @tanhf (float ) nounwind willreturn
45
46
46
47
define void @T () {
47
- entry:
48
48
; CHECK-LABEL: @T(
49
- ; CHECK-NEXT: entry:
49
+ ; CHECK-NEXT: entry:
50
+ ; CHECK-NEXT: [[LOG1:%.*]] = call double @log(double 0.000000e+00)
51
+ ; CHECK-NEXT: [[LOG2:%.*]] = call double @log(double -1.000000e+00)
52
+ ; CHECK-NEXT: [[EXP2:%.*]] = call double @exp(double 1.000000e+03)
53
+ ; CHECK-NEXT: [[COS2:%.*]] = call double @cos(double 0x7FF0000000000000)
54
+ ; CHECK-NEXT: [[COS3:%.*]] = call double @cos(double 0.000000e+00) [[ATTR2:#.*]]
55
+ ; CHECK-NEXT: [[FMOD2:%.*]] = call double @fmod(double 0x7FF0000000000000, double 1.000000e+00)
56
+ ; CHECK-NEXT: ret void
57
+ ;
58
+ entry:
50
59
51
60
; log(0) produces a pole error
52
- ; CHECK-NEXT: %log1 = call double @log(double 0.000000e+00)
53
61
%log1 = call double @log (double 0 .000000e+00 )
54
62
55
63
; log(-1) produces a domain error
56
- ; CHECK-NEXT: %log2 = call double @log(double -1.000000e+00)
57
64
%log2 = call double @log (double -1 .000000e+00 )
58
65
59
66
; log(1) is 0
@@ -63,18 +70,15 @@ entry:
63
70
%exp1 = call double @exp (double 1 .000000e+02 )
64
71
65
72
; exp(1000) is a range error
66
- ; CHECK-NEXT: %exp2 = call double @exp(double 1.000000e+03)
67
73
%exp2 = call double @exp (double 1 .000000e+03 )
68
74
69
75
; cos(0) is 1
70
76
%cos1 = call double @cos (double 0 .000000e+00 )
71
77
72
78
; cos(inf) is a domain error
73
- ; CHECK-NEXT: %cos2 = call double @cos(double 0x7FF0000000000000)
74
79
%cos2 = call double @cos (double 0x7FF0000000000000 )
75
80
76
- ; cos(0) nobuiltin may have side effects
77
- ; CHECK-NEXT: %cos3 = call double @cos(double 0.000000e+00)
81
+ ; cos(0) nobuiltin may have side effects
78
82
%cos3 = call double @cos (double 0 .000000e+00 ) nobuiltin
79
83
80
84
; pow(0, 1) is 0
@@ -88,22 +92,21 @@ entry:
88
92
%fmod1 = call double @fmod (double 0x7FF0000000000000 , double 0x7FF0000000000001 )
89
93
90
94
; fmod(inf, 1) is a domain error
91
- ; CHECK-NEXT: %fmod2 = call double @fmod(double 0x7FF0000000000000, double 1.000000e+00)
92
95
%fmod2 = call double @fmod (double 0x7FF0000000000000 , double 1 .000000e+00 )
93
96
94
- ; CHECK-NEXT: ret void
95
97
ret void
96
98
}
97
99
98
100
define void @Tstrict () strictfp {
99
- entry:
100
101
; CHECK-LABEL: @Tstrict(
101
- ; CHECK-NEXT: entry:
102
+ ; CHECK-NEXT: entry:
103
+ ; CHECK-NEXT: [[COS4:%.*]] = call double @cos(double 1.000000e+00) [[ATTR1:#.*]]
104
+ ; CHECK-NEXT: ret void
105
+ ;
106
+ entry:
102
107
103
108
; cos(1) strictfp sets FP status flags
104
- ; CHECK-NEXT: %cos4 = call double @cos(double 1.000000e+00)
105
109
%cos4 = call double @cos (double 1 .000000e+00 ) strictfp
106
110
107
- ; CHECK-NEXT: ret void
108
111
ret void
109
112
}
0 commit comments