R600: Fix JUMP handling so that MachineInstr verification can occur
[oota-llvm.git] / test / CodeGen / R600 / schedule-if.ll
1 ;RUN: llc < %s -march=r600 -mcpu=cayman -stress-sched -verify-misched
2
3 define void @main() {
4 main_body:
5   %0 = load <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>] addrspace(8)* null, i64 0, i32 1)
6   %1 = extractelement <4 x float> %0, i32 0
7   %2 = bitcast float %1 to i32
8   %3 = icmp eq i32 %2, 0
9   %4 = sext i1 %3 to i32
10   %5 = bitcast i32 %4 to float
11   %6 = bitcast float %5 to i32
12   %7 = icmp ne i32 %6, 0
13   br i1 %7, label %ENDIF, label %ELSE
14
15 ELSE:                                             ; preds = %main_body
16   %8 = load <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>] addrspace(8)* null, i64 0, i32 1)
17   %9 = extractelement <4 x float> %8, i32 0
18   %10 = bitcast float %9 to i32
19   %11 = icmp eq i32 %10, 1
20   %12 = sext i1 %11 to i32
21   %13 = bitcast i32 %12 to float
22   %14 = bitcast float %13 to i32
23   %15 = icmp ne i32 %14, 0
24   br i1 %15, label %IF13, label %ENDIF
25
26 ENDIF:                                            ; preds = %IF13, %ELSE, %main_body
27   %temp.0 = phi float [ 1.000000e+03, %main_body ], [ 1.000000e+00, %IF13 ], [ 0.000000e+00, %ELSE ]
28   %temp1.0 = phi float [ 0.000000e+00, %main_body ], [ %23, %IF13 ], [ 0.000000e+00, %ELSE ]
29   %temp3.0 = phi float [ 1.000000e+00, %main_body ], [ 0.000000e+00, %ELSE ], [ 0.000000e+00, %IF13 ]
30   %16 = insertelement <4 x float> undef, float %temp.0, i32 0
31   %17 = insertelement <4 x float> %16, float %temp1.0, i32 1
32   %18 = insertelement <4 x float> %17, float 0.000000e+00, i32 2
33   %19 = insertelement <4 x float> %18, float %temp3.0, i32 3
34   call void @llvm.R600.store.swizzle(<4 x float> %19, i32 0, i32 0)
35   ret void
36
37 IF13:                                             ; preds = %ELSE
38   %20 = load <4 x float> addrspace(8)* null
39   %21 = extractelement <4 x float> %20, i32 0
40   %22 = fsub float -0.000000e+00, %21
41   %23 = fadd float 1.000000e+03, %22
42   br label %ENDIF
43 }
44
45 declare void @llvm.R600.store.swizzle(<4 x float>, i32, i32)