46 lines · plain
1; RUN: llc -mtriple=amdgcn -mcpu=gfx900 -stop-after=prologepilog < %s | FileCheck -check-prefix=GCN %s2 3; It is a small loop test that iterates over the array member of the structure argument passed byval to the function.4; The loop code will keep the prologue and epilogue blocks apart.5; The test is primarily to check the temp register used to preserve the earlier FP value6; is live-in at every BB in the function.7 8%struct.Data = type { [20 x i32] }9 10define i32 @fp_save_restore_in_temp_sgpr(ptr addrspace(5) nocapture readonly byval(%struct.Data) align 4 %arg) #0 {11 ; GCN-LABEL: name: fp_save_restore_in_temp_sgpr12 ; GCN: bb.0.begin:13 ; GCN: liveins: $sgpr1114 ; GCN: $sgpr11 = frame-setup COPY $sgpr3315 ; GCN: $sgpr33 = frame-setup COPY $sgpr3216 ; GCN: bb.1.lp_end:17 ; GCN: liveins: $sgpr10, $sgpr11, $vgpr1, $sgpr4_sgpr5, $sgpr6_sgpr7, $sgpr8_sgpr918 ; GCN: bb.2.lp_begin:19 ; GCN: liveins: $sgpr10, $sgpr11, $vgpr1, $sgpr4_sgpr5, $sgpr6_sgpr720 ; GCN: bb.3.Flow:21 ; GCN: liveins: $sgpr10, $sgpr11, $vgpr0, $vgpr1, $sgpr4_sgpr5, $sgpr6_sgpr7, $sgpr8_sgpr922 ; GCN: bb.4.end:23 ; GCN: liveins: $sgpr11, $vgpr0, $sgpr4_sgpr524 ; GCN: $sgpr33 = frame-destroy COPY $sgpr1125begin:26 br label %lp_begin27 28lp_end: ; preds = %lp_begin29 %cur_idx = add nuw nsw i32 %idx, 130 %lp_term_cond = icmp eq i32 %cur_idx, 2031 br i1 %lp_term_cond, label %end, label %lp_begin32 33lp_begin: ; preds = %lp_end, %begin34 %idx = phi i32 [ 0, %begin ], [ %cur_idx, %lp_end ]35 %ptr = getelementptr inbounds %struct.Data, ptr addrspace(5) %arg, i32 0, i32 0, i32 %idx36 %data = load i32, ptr addrspace(5) %ptr, align 437 %data_cmp = icmp eq i32 %data, %idx38 br i1 %data_cmp, label %lp_end, label %end39 40end: ; preds = %lp_end, %lp_begin41 %ret_val = phi i32 [ 0, %lp_begin ], [ 1, %lp_end ]42 ret i32 %ret_val43}44 45attributes #0 = { norecurse nounwind "frame-pointer"="all" }46