File: fix-frame-ptr-reg-copy-livein.ll

package info (click to toggle)
llvm-toolchain-17 1%3A17.0.6-22
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,799,624 kB
  • sloc: cpp: 6,428,607; ansic: 1,383,196; asm: 793,408; python: 223,504; objc: 75,364; f90: 60,502; lisp: 33,869; pascal: 15,282; sh: 9,684; perl: 7,453; ml: 4,937; awk: 3,523; makefile: 2,889; javascript: 2,149; xml: 888; fortran: 619; cs: 573
file content (45 lines) | stat: -rw-r--r-- 2,039 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
; RUN: llc -march=amdgcn -mcpu=gfx900 -stop-after=prologepilog -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s

; It is a small loop test that iterates over the array member of the structure argument  passed byval to the function.
; The loop code will keep the prologue and epilogue blocks apart.
; The test is primarily to check the temp register used to preserve the earlier FP value
; is live-in at every BB in the function.

%struct.Data = type { [20 x i32] }

define i32 @fp_save_restore_in_temp_sgpr(ptr addrspace(5) nocapture readonly byval(%struct.Data) align 4 %arg) #0 {
  ; GCN-LABEL: name: fp_save_restore_in_temp_sgpr
  ; GCN: bb.0.begin:
  ; GCN:   liveins: $sgpr11
  ; GCN:   $sgpr11 = frame-setup COPY $sgpr33
  ; GCN:   $sgpr33 = frame-setup COPY $sgpr32
  ; GCN: bb.1.lp_end:
  ; GCN:   liveins: $sgpr10, $sgpr11, $vgpr1, $sgpr4_sgpr5, $sgpr6_sgpr7, $sgpr8_sgpr9
  ; GCN: bb.2.lp_begin:
  ; GCN:   liveins: $sgpr10, $sgpr11, $vgpr1, $sgpr4_sgpr5, $sgpr6_sgpr7
  ; GCN: bb.3.Flow:
  ; GCN:   liveins: $sgpr10, $sgpr11, $vgpr0, $vgpr1, $sgpr4_sgpr5, $sgpr6_sgpr7, $sgpr8_sgpr9
  ; GCN: bb.4.end:
  ; GCN:   liveins: $sgpr11, $vgpr0, $sgpr4_sgpr5
  ; GCN:   $sgpr33 = frame-destroy COPY $sgpr11
begin:
  br label %lp_begin

lp_end:                                                ; preds = %lp_begin
  %cur_idx = add nuw nsw i32 %idx, 1
  %lp_term_cond = icmp eq i32 %cur_idx, 20
  br i1 %lp_term_cond, label %end, label %lp_begin

lp_begin:                                                ; preds = %lp_end, %begin
  %idx = phi i32 [ 0, %begin ], [ %cur_idx, %lp_end ]
  %ptr = getelementptr inbounds %struct.Data, ptr addrspace(5) %arg, i32 0, i32 0, i32 %idx
  %data = load i32, ptr addrspace(5) %ptr, align 4
  %data_cmp = icmp eq i32 %data, %idx
  br i1 %data_cmp, label %lp_end, label %end

end:                                               ; preds = %lp_end, %lp_begin
  %ret_val = phi i32 [ 0, %lp_begin ], [ 1, %lp_end ]
  ret i32 %ret_val
}

attributes #0 = { norecurse nounwind "frame-pointer"="all" }