Vincent Lejeune | 269708b | 2013-10-01 19:32:38 +0000 | [diff] [blame] | 1 | ;RUN: llc < %s -march=r600 -mcpu=cayman -stress-sched -verify-misched -verify-machineinstrs |
NAKAMURA Takumi | e781913 | 2013-03-11 23:16:30 +0000 | [diff] [blame] | 2 | ;REQUIRES: asserts |
Vincent Lejeune | e5ecf10 | 2013-03-11 18:15:06 +0000 | [diff] [blame] | 3 | |
| 4 | define void @main() { |
| 5 | main_body: |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 6 | %0 = load <4 x float>, <4 x float> addrspace(9)* null |
Vincent Lejeune | e5ecf10 | 2013-03-11 18:15:06 +0000 | [diff] [blame] | 7 | %1 = extractelement <4 x float> %0, i32 3 |
| 8 | %2 = fptosi float %1 to i32 |
| 9 | %3 = bitcast i32 %2 to float |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 10 | %4 = load <4 x float>, <4 x float> addrspace(9)* null |
Vincent Lejeune | e5ecf10 | 2013-03-11 18:15:06 +0000 | [diff] [blame] | 11 | %5 = extractelement <4 x float> %4, i32 0 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 12 | %6 = load <4 x float>, <4 x float> addrspace(9)* null |
Vincent Lejeune | e5ecf10 | 2013-03-11 18:15:06 +0000 | [diff] [blame] | 13 | %7 = extractelement <4 x float> %6, i32 1 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 14 | %8 = load <4 x float>, <4 x float> addrspace(9)* null |
Vincent Lejeune | e5ecf10 | 2013-03-11 18:15:06 +0000 | [diff] [blame] | 15 | %9 = extractelement <4 x float> %8, i32 2 |
| 16 | br label %LOOP |
| 17 | |
| 18 | LOOP: ; preds = %ENDIF, %main_body |
| 19 | %temp4.0 = phi float [ %5, %main_body ], [ %temp5.0, %ENDIF ] |
| 20 | %temp5.0 = phi float [ %7, %main_body ], [ %temp6.0, %ENDIF ] |
| 21 | %temp6.0 = phi float [ %9, %main_body ], [ %temp4.0, %ENDIF ] |
| 22 | %temp8.0 = phi float [ 0.000000e+00, %main_body ], [ %27, %ENDIF ] |
| 23 | %10 = bitcast float %temp8.0 to i32 |
| 24 | %11 = bitcast float %3 to i32 |
| 25 | %12 = icmp sge i32 %10, %11 |
| 26 | %13 = sext i1 %12 to i32 |
| 27 | %14 = bitcast i32 %13 to float |
| 28 | %15 = bitcast float %14 to i32 |
| 29 | %16 = icmp ne i32 %15, 0 |
| 30 | br i1 %16, label %IF, label %ENDIF |
| 31 | |
| 32 | IF: ; preds = %LOOP |
| 33 | %17 = call float @llvm.AMDIL.clamp.(float %temp4.0, float 0.000000e+00, float 1.000000e+00) |
| 34 | %18 = call float @llvm.AMDIL.clamp.(float %temp5.0, float 0.000000e+00, float 1.000000e+00) |
| 35 | %19 = call float @llvm.AMDIL.clamp.(float %temp6.0, float 0.000000e+00, float 1.000000e+00) |
| 36 | %20 = call float @llvm.AMDIL.clamp.(float 1.000000e+00, float 0.000000e+00, float 1.000000e+00) |
| 37 | %21 = insertelement <4 x float> undef, float %17, i32 0 |
| 38 | %22 = insertelement <4 x float> %21, float %18, i32 1 |
| 39 | %23 = insertelement <4 x float> %22, float %19, i32 2 |
| 40 | %24 = insertelement <4 x float> %23, float %20, i32 3 |
| 41 | call void @llvm.R600.store.swizzle(<4 x float> %24, i32 0, i32 0) |
| 42 | ret void |
| 43 | |
| 44 | ENDIF: ; preds = %LOOP |
| 45 | %25 = bitcast float %temp8.0 to i32 |
| 46 | %26 = add i32 %25, 1 |
| 47 | %27 = bitcast i32 %26 to float |
| 48 | br label %LOOP |
| 49 | } |
| 50 | |
| 51 | declare float @llvm.AMDIL.clamp.(float, float, float) #0 |
| 52 | |
| 53 | declare void @llvm.R600.store.swizzle(<4 x float>, i32, i32) |
| 54 | |
| 55 | attributes #0 = { readnone } |