1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=sccp -S | FileCheck %s
4 define i1 @float.1.defaultenv(i1 %cmp) #0 {
5 ; CHECK-LABEL: @float.1.defaultenv(
7 ; CHECK-NEXT: br i1 [[CMP:%.*]], label [[IF_TRUE:%.*]], label [[END:%.*]]
9 ; CHECK-NEXT: br label [[END]]
11 ; CHECK-NEXT: ret i1 true
15 br i1 %cmp, label %if.true, label %end
21 %p = phi float [ 1.0, %entry ], [ 1.0, %if.true]
22 %c = call i1 @llvm.experimental.constrained.fcmps.i1.f32(float %p, float 1.0, metadata !"ueq", metadata !"fpexcept.ignore") #0
27 define i1 @float.1.maytrap(i1 %cmp) #0 {
28 ; CHECK-LABEL: @float.1.maytrap(
30 ; CHECK-NEXT: br i1 [[CMP:%.*]], label [[IF_TRUE:%.*]], label [[END:%.*]]
32 ; CHECK-NEXT: br label [[END]]
34 ; CHECK-NEXT: ret i1 true
38 br i1 %cmp, label %if.true, label %end
44 %p = phi float [ 1.0, %entry ], [ 1.0, %if.true]
45 %c = call i1 @llvm.experimental.constrained.fcmps.i1.f32(float %p, float 1.0, metadata !"ueq", metadata !"fpexcept.maytrap") #0
50 define i1 @float.1.strict(i1 %cmp) #0 {
51 ; CHECK-LABEL: @float.1.strict(
53 ; CHECK-NEXT: br i1 [[CMP:%.*]], label [[IF_TRUE:%.*]], label [[END:%.*]]
55 ; CHECK-NEXT: br label [[END]]
57 ; CHECK-NEXT: [[C:%.*]] = call i1 @llvm.experimental.constrained.fcmps.f32(float 1.000000e+00, float 1.000000e+00, metadata !"ueq", metadata !"fpexcept.strict") #[[ATTR0:[0-9]+]]
58 ; CHECK-NEXT: ret i1 true
62 br i1 %cmp, label %if.true, label %end
68 %p = phi float [ 1.0, %entry ], [ 1.0, %if.true]
69 %c = call i1 @llvm.experimental.constrained.fcmps.i1.f32(float %p, float 1.0, metadata !"ueq", metadata !"fpexcept.strict") #0
74 define i1 @float.2.defaultenv(i1 %cmp) #0 {
75 ; CHECK-LABEL: @float.2.defaultenv(
77 ; CHECK-NEXT: br i1 [[CMP:%.*]], label [[IF_TRUE:%.*]], label [[END:%.*]]
79 ; CHECK-NEXT: br label [[END]]
81 ; CHECK-NEXT: [[P:%.*]] = phi float [ 1.000000e+00, [[ENTRY:%.*]] ], [ 2.000000e+00, [[IF_TRUE]] ]
82 ; CHECK-NEXT: [[C:%.*]] = call i1 @llvm.experimental.constrained.fcmps.f32(float [[P]], float 1.000000e+00, metadata !"ueq", metadata !"fpexcept.ignore") #[[ATTR0]]
83 ; CHECK-NEXT: ret i1 [[C]]
87 br i1 %cmp, label %if.true, label %end
93 %p = phi float [ 1.0, %entry ], [ 2.0, %if.true]
94 %c = call i1 @llvm.experimental.constrained.fcmps.i1.f32(float %p, float 1.0, metadata !"ueq", metadata !"fpexcept.ignore") #0
98 define i1 @float.2.maytrap(i1 %cmp) #0 {
99 ; CHECK-LABEL: @float.2.maytrap(
101 ; CHECK-NEXT: br i1 [[CMP:%.*]], label [[IF_TRUE:%.*]], label [[END:%.*]]
103 ; CHECK-NEXT: br label [[END]]
105 ; CHECK-NEXT: [[P:%.*]] = phi float [ 1.000000e+00, [[ENTRY:%.*]] ], [ 2.000000e+00, [[IF_TRUE]] ]
106 ; CHECK-NEXT: [[C:%.*]] = call i1 @llvm.experimental.constrained.fcmps.f32(float [[P]], float 1.000000e+00, metadata !"ueq", metadata !"fpexcept.maytrap") #[[ATTR0]]
107 ; CHECK-NEXT: ret i1 [[C]]
111 br i1 %cmp, label %if.true, label %end
117 %p = phi float [ 1.0, %entry ], [ 2.0, %if.true]
118 %c = call i1 @llvm.experimental.constrained.fcmps.i1.f32(float %p, float 1.0, metadata !"ueq", metadata !"fpexcept.maytrap") #0
122 define i1 @float.2.strict(i1 %cmp) #0 {
123 ; CHECK-LABEL: @float.2.strict(
125 ; CHECK-NEXT: br i1 [[CMP:%.*]], label [[IF_TRUE:%.*]], label [[END:%.*]]
127 ; CHECK-NEXT: br label [[END]]
129 ; CHECK-NEXT: [[P:%.*]] = phi float [ 1.000000e+00, [[ENTRY:%.*]] ], [ 2.000000e+00, [[IF_TRUE]] ]
130 ; CHECK-NEXT: [[C:%.*]] = call i1 @llvm.experimental.constrained.fcmps.f32(float [[P]], float 1.000000e+00, metadata !"ueq", metadata !"fpexcept.strict") #[[ATTR0]]
131 ; CHECK-NEXT: ret i1 [[C]]
135 br i1 %cmp, label %if.true, label %end
141 %p = phi float [ 1.0, %entry ], [ 2.0, %if.true]
142 %c = call i1 @llvm.experimental.constrained.fcmps.i1.f32(float %p, float 1.0, metadata !"ueq", metadata !"fpexcept.strict") #0
146 define i1 @float.3.defaultenv(float %f, i1 %cmp) #0 {
147 ; CHECK-LABEL: @float.3.defaultenv(
149 ; CHECK-NEXT: br i1 [[CMP:%.*]], label [[IF_TRUE:%.*]], label [[END:%.*]]
151 ; CHECK-NEXT: br label [[END]]
153 ; CHECK-NEXT: [[P:%.*]] = phi float [ 1.000000e+00, [[ENTRY:%.*]] ], [ [[F:%.*]], [[IF_TRUE]] ]
154 ; CHECK-NEXT: [[C:%.*]] = call i1 @llvm.experimental.constrained.fcmps.f32(float [[P]], float 1.000000e+00, metadata !"ueq", metadata !"fpexcept.ignore") #[[ATTR0]]
155 ; CHECK-NEXT: ret i1 [[C]]
159 br i1 %cmp, label %if.true, label %end
165 %p = phi float [ 1.0, %entry ], [ %f, %if.true]
166 %c = call i1 @llvm.experimental.constrained.fcmps.i1.f32(float %p, float 1.0, metadata !"ueq", metadata !"fpexcept.ignore") #0
170 define i1 @float.3.maytrap(float %f, i1 %cmp) #0 {
171 ; CHECK-LABEL: @float.3.maytrap(
173 ; CHECK-NEXT: br i1 [[CMP:%.*]], label [[IF_TRUE:%.*]], label [[END:%.*]]
175 ; CHECK-NEXT: br label [[END]]
177 ; CHECK-NEXT: [[P:%.*]] = phi float [ 1.000000e+00, [[ENTRY:%.*]] ], [ [[F:%.*]], [[IF_TRUE]] ]
178 ; CHECK-NEXT: [[C:%.*]] = call i1 @llvm.experimental.constrained.fcmps.f32(float [[P]], float 1.000000e+00, metadata !"ueq", metadata !"fpexcept.maytrap") #[[ATTR0]]
179 ; CHECK-NEXT: ret i1 [[C]]
183 br i1 %cmp, label %if.true, label %end
189 %p = phi float [ 1.0, %entry ], [ %f, %if.true]
190 %c = call i1 @llvm.experimental.constrained.fcmps.i1.f32(float %p, float 1.0, metadata !"ueq", metadata !"fpexcept.maytrap") #0
194 define i1 @float.3.strict(float %f, i1 %cmp) #0 {
195 ; CHECK-LABEL: @float.3.strict(
197 ; CHECK-NEXT: br i1 [[CMP:%.*]], label [[IF_TRUE:%.*]], label [[END:%.*]]
199 ; CHECK-NEXT: br label [[END]]
201 ; CHECK-NEXT: [[P:%.*]] = phi float [ 1.000000e+00, [[ENTRY:%.*]] ], [ [[F:%.*]], [[IF_TRUE]] ]
202 ; CHECK-NEXT: [[C:%.*]] = call i1 @llvm.experimental.constrained.fcmps.f32(float [[P]], float 1.000000e+00, metadata !"ueq", metadata !"fpexcept.strict") #[[ATTR0]]
203 ; CHECK-NEXT: ret i1 [[C]]
207 br i1 %cmp, label %if.true, label %end
213 %p = phi float [ 1.0, %entry ], [ %f, %if.true]
214 %c = call i1 @llvm.experimental.constrained.fcmps.i1.f32(float %p, float 1.0, metadata !"ueq", metadata !"fpexcept.strict") #0
218 define i1 @float.4_unreachable.defaultenv(float %f, i1 %cmp) #0 {
219 ; CHECK-LABEL: @float.4_unreachable.defaultenv(
221 ; CHECK-NEXT: br i1 [[CMP:%.*]], label [[IF_TRUE:%.*]], label [[END:%.*]]
223 ; CHECK-NEXT: br label [[END]]
225 ; CHECK-NEXT: ret i1 false
229 br i1 %cmp, label %if.true, label %end
238 %p = phi float [ 1.0, %entry ], [ 1.0, %if.true], [ %f, %dead ]
239 %c = call i1 @llvm.experimental.constrained.fcmps.i1.f32(float %p, float 1.0, metadata !"une", metadata !"fpexcept.ignore") #0
243 define i1 @float.4_unreachable.maytrap(float %f, i1 %cmp) #0 {
244 ; CHECK-LABEL: @float.4_unreachable.maytrap(
246 ; CHECK-NEXT: br i1 [[CMP:%.*]], label [[IF_TRUE:%.*]], label [[END:%.*]]
248 ; CHECK-NEXT: br label [[END]]
250 ; CHECK-NEXT: ret i1 false
254 br i1 %cmp, label %if.true, label %end
263 %p = phi float [ 1.0, %entry ], [ 1.0, %if.true], [ %f, %dead ]
264 %c = call i1 @llvm.experimental.constrained.fcmps.i1.f32(float %p, float 1.0, metadata !"une", metadata !"fpexcept.maytrap") #0
268 ; FIXME: It's a shame we can't eliminate this fcmps here:
269 define i1 @float.4_unreachable.strict(float %f, i1 %cmp) #0 {
270 ; CHECK-LABEL: @float.4_unreachable.strict(
272 ; CHECK-NEXT: br i1 [[CMP:%.*]], label [[IF_TRUE:%.*]], label [[END:%.*]]
274 ; CHECK-NEXT: br label [[END]]
276 ; CHECK-NEXT: [[C:%.*]] = call i1 @llvm.experimental.constrained.fcmps.f32(float 1.000000e+00, float 1.000000e+00, metadata !"une", metadata !"fpexcept.strict") #[[ATTR0]]
277 ; CHECK-NEXT: ret i1 false
281 br i1 %cmp, label %if.true, label %end
290 %p = phi float [ 1.0, %entry ], [ 1.0, %if.true], [ %f, %dead ]
291 %c = call i1 @llvm.experimental.constrained.fcmps.i1.f32(float %p, float 1.0, metadata !"une", metadata !"fpexcept.strict") #0
295 attributes #0 = { strictfp }
297 declare i1 @llvm.experimental.constrained.fcmps.i1.f32(float, float, metadata, metadata)