Krzysztof Parzyszek | 046090d | 2018-03-12 14:01:28 +0000 | [diff] [blame] | 1 | ; RUN: llc -march=hexagon < %s | FileCheck %s |
| 2 | |
| 3 | ; Test that the hardware loop pass does not alter the comparison |
| 4 | ; to use the result from the induction expression instead of |
| 5 | ; from the Phi. |
| 6 | |
| 7 | ; CHECK: cmpb.gtu([[REG0:r[0-9]+]] |
| 8 | ; CHECK: [[REG0]] = add([[REG0]], |
| 9 | |
| 10 | define void @f0() #0 { |
| 11 | b0: |
| 12 | br label %b1 |
| 13 | |
| 14 | b1: ; preds = %b1, %b0 |
| 15 | br i1 undef, label %b1, label %b2 |
| 16 | |
| 17 | b2: ; preds = %b2, %b1 |
| 18 | %v0 = phi i32 [ %v3, %b2 ], [ undef, %b1 ] |
| 19 | %v1 = trunc i32 %v0 to i8 |
| 20 | %v2 = icmp ugt i8 %v1, 44 |
| 21 | %v3 = add i32 %v0, -30 |
| 22 | br i1 %v2, label %b2, label %b3 |
| 23 | |
| 24 | b3: ; preds = %b2 |
| 25 | ret void |
| 26 | } |
| 27 | |
| 28 | attributes #0 = { nounwind "target-cpu"="hexagonv55" } |