1 ; RUN: llc -march=hexagon < %s | FileCheck %s
3 target triple = "hexagon"
5 ; FP elimination enabled.
8 ; CHECK: r29 = add(r29,#-[[SIZE:[0-9]+]])
9 ; CHECK: r29 = add(r29,#[[SIZE]])
10 define i32 @danny(i32 %a0, i32 %a1) local_unnamed_addr #0 {
12 %v3 = alloca [32 x i32], align 8
13 call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %v3) #3
16 b5: ; preds = %b5, %b2
17 %v6 = phi i32 [ 0, %b2 ], [ %v8, %b5 ]
18 %v7 = getelementptr inbounds [32 x i32], ptr %v3, i32 0, i32 %v6
19 store i32 %v6, ptr %v7, align 4
20 %v8 = add nuw nsw i32 %v6, 1
21 %v9 = icmp eq i32 %v8, 32
22 br i1 %v9, label %b10, label %b5
25 %v11 = getelementptr inbounds [32 x i32], ptr %v3, i32 0, i32 %a0
26 store i32 %a1, ptr %v11, align 4
29 b12: ; preds = %b12, %b10
30 %v13 = phi i32 [ 0, %b10 ], [ %v18, %b12 ]
31 %v14 = phi i32 [ 0, %b10 ], [ %v17, %b12 ]
32 %v15 = getelementptr inbounds [32 x i32], ptr %v3, i32 0, i32 %v13
33 %v16 = load i32, ptr %v15, align 4
34 %v17 = add nsw i32 %v16, %v14
35 %v18 = add nuw nsw i32 %v13, 1
36 %v19 = icmp eq i32 %v18, 32
37 br i1 %v19, label %b20, label %b12
40 call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %v3) #3
44 ; FP elimination disabled.
48 ; CHECK: dealloc_return
49 define i32 @sammy(i32 %a0, i32 %a1) local_unnamed_addr #1 {
51 %v3 = alloca [32 x i32], align 8
52 call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %v3) #3
55 b5: ; preds = %b5, %b2
56 %v6 = phi i32 [ 0, %b2 ], [ %v8, %b5 ]
57 %v7 = getelementptr inbounds [32 x i32], ptr %v3, i32 0, i32 %v6
58 store i32 %v6, ptr %v7, align 4
59 %v8 = add nuw nsw i32 %v6, 1
60 %v9 = icmp eq i32 %v8, 32
61 br i1 %v9, label %b10, label %b5
64 %v11 = getelementptr inbounds [32 x i32], ptr %v3, i32 0, i32 %a0
65 store i32 %a1, ptr %v11, align 4
68 b12: ; preds = %b12, %b10
69 %v13 = phi i32 [ 0, %b10 ], [ %v18, %b12 ]
70 %v14 = phi i32 [ 0, %b10 ], [ %v17, %b12 ]
71 %v15 = getelementptr inbounds [32 x i32], ptr %v3, i32 0, i32 %v13
72 %v16 = load i32, ptr %v15, align 4
73 %v17 = add nsw i32 %v16, %v14
74 %v18 = add nuw nsw i32 %v13, 1
75 %v19 = icmp eq i32 %v18, 32
76 br i1 %v19, label %b20, label %b12
79 call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %v3) #3
83 declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #2
84 declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #2
86 attributes #0 = { nounwind readnone "frame-pointer"="none" "target-cpu"="hexagonv60" }
87 attributes #1 = { nounwind readnone "frame-pointer"="all" "target-cpu"="hexagonv60" }
88 attributes #2 = { argmemonly nounwind }
89 attributes #3 = { nounwind }