1 ; RUN: llc -march=hexagon < %s | FileCheck %s 2 3 target triple = "hexagon" 4 5 ; FP elimination enabled. 6 ; 7 ; CHECK-LABEL: danny: 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 { 11 b2: 12 %v3 = alloca [32 x i32], align 8 13 %v4 = bitcast [32 x i32]* %v3 to i8* 14 call void @llvm.lifetime.start.p0i8(i64 128, i8* nonnull %v4) #3 15 br label %b5 16 17 b5: ; preds = %b5, %b2 18 %v6 = phi i32 [ 0, %b2 ], [ %v8, %b5 ] 19 %v7 = getelementptr inbounds [32 x i32], [32 x i32]* %v3, i32 0, i32 %v6 20 store i32 %v6, i32* %v7, align 4 21 %v8 = add nuw nsw i32 %v6, 1 22 %v9 = icmp eq i32 %v8, 32 23 br i1 %v9, label %b10, label %b5 24 25 b10: ; preds = %b5 26 %v11 = getelementptr inbounds [32 x i32], [32 x i32]* %v3, i32 0, i32 %a0 27 store i32 %a1, i32* %v11, align 4 28 br label %b12 29 30 b12: ; preds = %b12, %b10 31 %v13 = phi i32 [ 0, %b10 ], [ %v18, %b12 ] 32 %v14 = phi i32 [ 0, %b10 ], [ %v17, %b12 ] 33 %v15 = getelementptr inbounds [32 x i32], [32 x i32]* %v3, i32 0, i32 %v13 34 %v16 = load i32, i32* %v15, align 4 35 %v17 = add nsw i32 %v16, %v14 36 %v18 = add nuw nsw i32 %v13, 1 37 %v19 = icmp eq i32 %v18, 32 38 br i1 %v19, label %b20, label %b12 39 40 b20: ; preds = %b12 41 call void @llvm.lifetime.end.p0i8(i64 128, i8* nonnull %v4) #3 42 ret i32 %v17 43 } 44 45 ; FP elimination disabled. 46 ; 47 ; CHECK-LABEL: sammy: 48 ; CHECK: allocframe 49 ; CHECK: dealloc_return 50 define i32 @sammy(i32 %a0, i32 %a1) local_unnamed_addr #1 { 51 b2: 52 %v3 = alloca [32 x i32], align 8 53 %v4 = bitcast [32 x i32]* %v3 to i8* 54 call void @llvm.lifetime.start.p0i8(i64 128, i8* nonnull %v4) #3 55 br label %b5 56 57 b5: ; preds = %b5, %b2 58 %v6 = phi i32 [ 0, %b2 ], [ %v8, %b5 ] 59 %v7 = getelementptr inbounds [32 x i32], [32 x i32]* %v3, i32 0, i32 %v6 60 store i32 %v6, i32* %v7, align 4 61 %v8 = add nuw nsw i32 %v6, 1 62 %v9 = icmp eq i32 %v8, 32 63 br i1 %v9, label %b10, label %b5 64 65 b10: ; preds = %b5 66 %v11 = getelementptr inbounds [32 x i32], [32 x i32]* %v3, i32 0, i32 %a0 67 store i32 %a1, i32* %v11, align 4 68 br label %b12 69 70 b12: ; preds = %b12, %b10 71 %v13 = phi i32 [ 0, %b10 ], [ %v18, %b12 ] 72 %v14 = phi i32 [ 0, %b10 ], [ %v17, %b12 ] 73 %v15 = getelementptr inbounds [32 x i32], [32 x i32]* %v3, i32 0, i32 %v13 74 %v16 = load i32, i32* %v15, align 4 75 %v17 = add nsw i32 %v16, %v14 76 %v18 = add nuw nsw i32 %v13, 1 77 %v19 = icmp eq i32 %v18, 32 78 br i1 %v19, label %b20, label %b12 79 80 b20: ; preds = %b12 81 call void @llvm.lifetime.end.p0i8(i64 128, i8* nonnull %v4) #3 82 ret i32 %v17 83 } 84 85 declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #2 86 declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #2 87 88 attributes #0 = { nounwind readnone "no-frame-pointer-elim"="false" "target-cpu"="hexagonv60" } 89 attributes #1 = { nounwind readnone "no-frame-pointer-elim"="true" "target-cpu"="hexagonv60" } 90 attributes #2 = { argmemonly nounwind } 91 attributes #3 = { nounwind } 92