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 compiler does not generate an invalid packet with three |
| 4 | ; instructions that each requires slot 2 or 3. The specification for |
| 5 | ; PS_call_nr was incorrect, which allowed that instrution to go in any slot. |
| 6 | |
| 7 | ; CHECK: extractu |
| 8 | ; CHECK: extractu |
| 9 | ; CHECK: { |
| 10 | ; CHECK: call |
| 11 | |
| 12 | %s.0 = type <{ i8*, i8*, i16, i8, i8, i8 }> |
| 13 | |
| 14 | @g0 = external constant %s.0, section ".rodata.trace", align 1 |
| 15 | |
| 16 | define void @f0() local_unnamed_addr { |
| 17 | b0: |
| 18 | %v0 = load i32, i32* undef, align 4 |
| 19 | %v1 = trunc i32 %v0 to i2 |
| 20 | switch i2 %v1, label %b4 [ |
| 21 | i2 1, label %b1 |
| 22 | i2 -1, label %b2 |
| 23 | i2 -2, label %b2 |
| 24 | i2 0, label %b3 |
| 25 | ] |
| 26 | |
| 27 | b1: ; preds = %b0 |
| 28 | unreachable |
| 29 | |
| 30 | b2: ; preds = %b0, %b0 |
| 31 | %v2 = load i32, i32* undef, align 4 |
| 32 | %v3 = lshr i32 %v2, 14 |
| 33 | %v4 = and i32 %v3, 2047 |
| 34 | %v5 = lshr i32 %v2, 3 |
| 35 | %v6 = and i32 %v5, 2047 |
| 36 | tail call void @f1(%s.0* nonnull @g0, i32 %v6, i32 %v4, i32 0, i32 0) |
| 37 | unreachable |
| 38 | |
| 39 | b3: ; preds = %b0 |
| 40 | ret void |
| 41 | |
| 42 | b4: ; preds = %b0 |
| 43 | unreachable |
| 44 | } |
| 45 | |
| 46 | declare void @f1(%s.0*, i32, i32, i32, i32) local_unnamed_addr |