blob: 6637b3897717e9d1f90ccf90f5d5482da31cabfb [file] [log] [blame]
Vincent Lejeune269708b2013-10-01 19:32:38 +00001;RUN: llc < %s -march=r600 -mcpu=cayman -stress-sched -verify-misched -verify-machineinstrs
NAKAMURA Takumie7819132013-03-11 23:16:30 +00002;REQUIRES: asserts
Vincent Lejeunee5ecf102013-03-11 18:15:06 +00003
4define void @main() {
5main_body:
David Blaikief72d05b2015-03-13 18:20:45 +00006 %0 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>], [1024 x <4 x float>] addrspace(8)* null, i64 0, i32 1)
Vincent Lejeunee5ecf102013-03-11 18:15:06 +00007 %1 = extractelement <4 x float> %0, i32 0
8 %2 = bitcast float %1 to i32
9 %3 = icmp eq i32 %2, 0
10 %4 = sext i1 %3 to i32
11 %5 = bitcast i32 %4 to float
12 %6 = bitcast float %5 to i32
13 %7 = icmp ne i32 %6, 0
14 br i1 %7, label %ENDIF, label %ELSE
15
16ELSE: ; preds = %main_body
David Blaikief72d05b2015-03-13 18:20:45 +000017 %8 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>], [1024 x <4 x float>] addrspace(8)* null, i64 0, i32 1)
Vincent Lejeunee5ecf102013-03-11 18:15:06 +000018 %9 = extractelement <4 x float> %8, i32 0
19 %10 = bitcast float %9 to i32
20 %11 = icmp eq i32 %10, 1
21 %12 = sext i1 %11 to i32
22 %13 = bitcast i32 %12 to float
23 %14 = bitcast float %13 to i32
24 %15 = icmp ne i32 %14, 0
25 br i1 %15, label %IF13, label %ENDIF
26
27ENDIF: ; preds = %IF13, %ELSE, %main_body
28 %temp.0 = phi float [ 1.000000e+03, %main_body ], [ 1.000000e+00, %IF13 ], [ 0.000000e+00, %ELSE ]
29 %temp1.0 = phi float [ 0.000000e+00, %main_body ], [ %23, %IF13 ], [ 0.000000e+00, %ELSE ]
30 %temp3.0 = phi float [ 1.000000e+00, %main_body ], [ 0.000000e+00, %ELSE ], [ 0.000000e+00, %IF13 ]
31 %16 = insertelement <4 x float> undef, float %temp.0, i32 0
32 %17 = insertelement <4 x float> %16, float %temp1.0, i32 1
33 %18 = insertelement <4 x float> %17, float 0.000000e+00, i32 2
34 %19 = insertelement <4 x float> %18, float %temp3.0, i32 3
Matt Arsenault82e5e1e2016-07-15 21:27:08 +000035 call void @llvm.r600.store.swizzle(<4 x float> %19, i32 0, i32 0)
Vincent Lejeunee5ecf102013-03-11 18:15:06 +000036 ret void
37
38IF13: ; preds = %ELSE
David Blaikiea79ac142015-02-27 21:17:42 +000039 %20 = load <4 x float>, <4 x float> addrspace(8)* null
Vincent Lejeunee5ecf102013-03-11 18:15:06 +000040 %21 = extractelement <4 x float> %20, i32 0
41 %22 = fsub float -0.000000e+00, %21
42 %23 = fadd float 1.000000e+03, %22
43 br label %ENDIF
44}
45
Matt Arsenault82e5e1e2016-07-15 21:27:08 +000046declare void @llvm.r600.store.swizzle(<4 x float>, i32, i32)