1; RUN: llc -march=r600 -mcpu=cayman -stress-sched -verify-misched -verify-machineinstrs < %s
2; REQUIRES: asserts
3
4define amdgpu_vs void @main(<4 x float> inreg %reg0, <4 x float> inreg %reg1) #0 {
5main_body:
6  %tmp = extractelement <4 x float> %reg1, i32 0
7  %tmp5 = extractelement <4 x float> %reg1, i32 1
8  %tmp6 = extractelement <4 x float> %reg1, i32 2
9  %tmp7 = extractelement <4 x float> %reg1, i32 3
10  %tmp8 = fcmp ult float %tmp5, 0.000000e+00
11  %tmp9 = select i1 %tmp8, float 1.000000e+00, float 0.000000e+00
12  %tmp10 = fsub float -0.000000e+00, %tmp9
13  %tmp11 = fptosi float %tmp10 to i32
14  %tmp12 = bitcast i32 %tmp11 to float
15  %tmp13 = fcmp ult float %tmp, 5.700000e+01
16  %tmp14 = select i1 %tmp13, float 1.000000e+00, float 0.000000e+00
17  %tmp15 = fsub float -0.000000e+00, %tmp14
18  %tmp16 = fptosi float %tmp15 to i32
19  %tmp17 = bitcast i32 %tmp16 to float
20  %tmp18 = bitcast float %tmp12 to i32
21  %tmp19 = bitcast float %tmp17 to i32
22  %tmp20 = and i32 %tmp18, %tmp19
23  %tmp21 = bitcast i32 %tmp20 to float
24  %tmp22 = bitcast float %tmp21 to i32
25  %tmp23 = icmp ne i32 %tmp22, 0
26  %tmp24 = fcmp ult float %tmp, 0.000000e+00
27  %tmp25 = select i1 %tmp24, float 1.000000e+00, float 0.000000e+00
28  %tmp26 = fsub float -0.000000e+00, %tmp25
29  %tmp27 = fptosi float %tmp26 to i32
30  %tmp28 = bitcast i32 %tmp27 to float
31  %tmp29 = bitcast float %tmp28 to i32
32  %tmp30 = icmp ne i32 %tmp29, 0
33  br i1 %tmp23, label %IF, label %ELSE
34
35IF:                                               ; preds = %main_body
36  %. = select i1 %tmp30, float 0.000000e+00, float 1.000000e+00
37  %.18 = select i1 %tmp30, float 1.000000e+00, float 0.000000e+00
38  br label %ENDIF
39
40ELSE:                                             ; preds = %main_body
41  br i1 %tmp30, label %ENDIF, label %ELSE17
42
43ENDIF:                                            ; preds = %ELSE17, %ELSE, %IF
44  %temp1.0 = phi float [ %., %IF ], [ %tmp48, %ELSE17 ], [ 0.000000e+00, %ELSE ]
45  %temp2.0 = phi float [ 0.000000e+00, %IF ], [ %tmp49, %ELSE17 ], [ 1.000000e+00, %ELSE ]
46  %temp.0 = phi float [ %.18, %IF ], [ %tmp47, %ELSE17 ], [ 0.000000e+00, %ELSE ]
47  %max.0.i = call float @llvm.maxnum.f32(float %temp.0, float 0.000000e+00)
48  %clamp.i = call float @llvm.minnum.f32(float %max.0.i, float 1.000000e+00)
49  %max.0.i3 = call float @llvm.maxnum.f32(float %temp1.0, float 0.000000e+00)
50  %clamp.i4 = call float @llvm.minnum.f32(float %max.0.i3, float 1.000000e+00)
51  %max.0.i1 = call float @llvm.maxnum.f32(float %temp2.0, float 0.000000e+00)
52  %clamp.i2 = call float @llvm.minnum.f32(float %max.0.i1, float 1.000000e+00)
53  %tmp31 = insertelement <4 x float> undef, float %clamp.i, i32 0
54  %tmp32 = insertelement <4 x float> %tmp31, float %clamp.i4, i32 1
55  %tmp33 = insertelement <4 x float> %tmp32, float %clamp.i2, i32 2
56  %tmp34 = insertelement <4 x float> %tmp33, float 1.000000e+00, i32 3
57  call void @llvm.r600.store.swizzle(<4 x float> %tmp34, i32 0, i32 0)
58  ret void
59
60ELSE17:                                           ; preds = %ELSE
61  %tmp35 = fadd float 0.000000e+00, 0x3FC99999A0000000
62  %tmp36 = fadd float 0.000000e+00, 0x3FC99999A0000000
63  %tmp37 = fadd float 0.000000e+00, 0x3FC99999A0000000
64  %tmp38 = fadd float %tmp35, 0x3FC99999A0000000
65  %tmp39 = fadd float %tmp36, 0x3FC99999A0000000
66  %tmp40 = fadd float %tmp37, 0x3FC99999A0000000
67  %tmp41 = fadd float %tmp38, 0x3FC99999A0000000
68  %tmp42 = fadd float %tmp39, 0x3FC99999A0000000
69  %tmp43 = fadd float %tmp40, 0x3FC99999A0000000
70  %tmp44 = fadd float %tmp41, 0x3FC99999A0000000
71  %tmp45 = fadd float %tmp42, 0x3FC99999A0000000
72  %tmp46 = fadd float %tmp43, 0x3FC99999A0000000
73  %tmp47 = fadd float %tmp44, 0x3FC99999A0000000
74  %tmp48 = fadd float %tmp45, 0x3FC99999A0000000
75  %tmp49 = fadd float %tmp46, 0x3FC99999A0000000
76  br label %ENDIF
77}
78
79declare float @llvm.minnum.f32(float, float) #1
80declare float @llvm.maxnum.f32(float, float) #1
81declare void @llvm.r600.store.swizzle(<4 x float>, i32, i32) #0
82
83attributes #0 = { nounwind }
84attributes #1 = { nounwind readnone }
85