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 first packet contains 4 instructions, which includes |
| 4 | ; a call. The compiler marked the call as constant extended incorrectly, |
| 5 | ; which meant it couldn't fit in the first packet. But, calls are not |
| 6 | ; constant extended by the compiler. |
| 7 | |
| 8 | ; CHECK: { |
| 9 | ; CHECK-NEXT: call f1 |
| 10 | ; CHECK-NEXT: combine |
| 11 | ; CHECK-NEXT: memd |
| 12 | ; CHECK-NEXT: allocframe |
| 13 | ; CHECK-NEXT: } |
| 14 | |
| 15 | |
| 16 | @g0 = external global i32 |
| 17 | |
| 18 | ; Function Attrs: noinline nounwind |
| 19 | define i32 @f0(i32 %a0, i32* nocapture %a1) #0 { |
| 20 | b0: |
| 21 | %v0 = tail call i32 @f1(i32 %a0) |
| 22 | %v1 = icmp eq i32 %v0, 0 |
| 23 | %v2 = select i1 %v1, i32 3, i32 %a0 |
| 24 | store i32 %v2, i32* %a1, align 4 |
| 25 | switch i32 %a0, label %b5 [ |
| 26 | i32 0, label %b1 |
| 27 | i32 1, label %b2 |
| 28 | i32 2, label %b3 |
| 29 | i32 4, label %b4 |
| 30 | ] |
| 31 | |
| 32 | b1: ; preds = %b0 |
| 33 | store i32 0, i32* %a1, align 4 |
| 34 | br label %b5 |
| 35 | |
| 36 | b2: ; preds = %b0 |
| 37 | %v3 = load i32, i32* @g0, align 4 |
| 38 | %v4 = icmp sgt i32 %v3, 100 |
| 39 | %v5 = select i1 %v4, i32 0, i32 3 |
| 40 | store i32 %v5, i32* %a1, align 4 |
| 41 | br label %b5 |
| 42 | |
| 43 | b3: ; preds = %b0 |
| 44 | store i32 1, i32* %a1, align 4 |
| 45 | br label %b5 |
| 46 | |
| 47 | b4: ; preds = %b0 |
| 48 | store i32 2, i32* %a1, align 4 |
| 49 | br label %b5 |
| 50 | |
| 51 | b5: ; preds = %b4, %b3, %b2, %b1, %b0 |
| 52 | ret i32 undef |
| 53 | } |
| 54 | |
| 55 | ; Function Attrs: noinline nounwind readnone |
| 56 | declare i32 @f1(i32) #1 |
| 57 | |
| 58 | attributes #0 = { noinline nounwind "target-cpu"="hexagonv60" } |
| 59 | attributes #1 = { noinline nounwind readnone "target-cpu"="hexagonv60" } |