1 ; RUN: llc -march=hexagon < %s | FileCheck %s 2 ; Check that there are no packets with two or more instructions, except 3 ; for the endloop packet. 4 5 ; This is the expected code: 6 ; 7 ; p0 = cmp.gt(r3,#0) 8 ; if (!p0) jump:nt .LBB0_3 9 ; loop0(.LBB0_2,r3) 10 ; r3 = memw(r1++#4) 11 ; r4 = memw(r2++#4) 12 ; r3 = add(r4,r3) 13 ; memw(r0++#4) = r3 14 ; { nop; nop }:endloop0 15 ; jumpr r31 16 17 ; CHECK-LABEL: fred: 18 ; CHECK: { 19 ; CHECK-NEXT: cmp 20 ; CHECK-NEXT: } 21 ; CHECK: { 22 ; CHECK-NEXT: jump 23 ; CHECK-NEXT: } 24 ; CHECK: { 25 ; CHECK-NEXT: loop0 26 ; CHECK-NEXT: } 27 ; CHECK: { 28 ; CHECK-NEXT: memw 29 ; CHECK-NEXT: } 30 ; CHECK: { 31 ; CHECK-NEXT: memw 32 ; CHECK-NEXT: } 33 ; CHECK: { 34 ; CHECK-NEXT: add 35 ; CHECK-NEXT: } 36 ; CHECK: { 37 ; CHECK-NEXT: memw 38 ; CHECK-NEXT: } 39 ; CHECK: { 40 ; CHECK-NEXT: nop 41 ; CHECK-NEXT: nop 42 ; CHECK-NEXT: }{{[ \t]*}}:endloop0 43 ; CHECK: { 44 ; CHECK-NEXT: jumpr r31 45 ; CHECK-NEXT: } 46 47 target triple = "hexagon" 48 49 50 define void @fred(i32* nocapture %a0, i32* nocapture readonly %a1, i32* nocapture readonly %a2, i32 %a3) local_unnamed_addr #0 { 51 b4: 52 %v5 = icmp sgt i32 %a3, 0 53 br i1 %v5, label %b6, label %b21 54 55 b6: ; preds = %b4 56 br label %b7 57 58 b7: ; preds = %b7, %b6 59 %v8 = phi i32 [ %v18, %b7 ], [ 0, %b6 ] 60 %v9 = phi i32* [ %v17, %b7 ], [ %a0, %b6 ] 61 %v10 = phi i32* [ %v14, %b7 ], [ %a2, %b6 ] 62 %v11 = phi i32* [ %v12, %b7 ], [ %a1, %b6 ] 63 %v12 = getelementptr inbounds i32, i32* %v11, i32 1 64 %v13 = load i32, i32* %v11, align 4 65 %v14 = getelementptr inbounds i32, i32* %v10, i32 1 66 %v15 = load i32, i32* %v10, align 4 67 %v16 = add nsw i32 %v15, %v13 68 %v17 = getelementptr inbounds i32, i32* %v9, i32 1 69 store i32 %v16, i32* %v9, align 4 70 %v18 = add nuw nsw i32 %v8, 1 71 %v19 = icmp eq i32 %v18, %a3 72 br i1 %v19, label %b20, label %b7 73 74 b20: ; preds = %b7 75 br label %b21 76 77 b21: ; preds = %b20, %b4 78 ret void 79 } 80 81 attributes #0 = { norecurse nounwind "target-cpu"="hexagonv60" "target-features"="-packets" } 82 83