File: shrink-wrap.ll

package info (click to toggle)
llvm-toolchain-16 1%3A16.0.6-15~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,634,792 kB
  • sloc: cpp: 6,179,261; ansic: 1,216,205; asm: 741,319; python: 196,614; objc: 75,325; f90: 49,640; lisp: 32,396; pascal: 12,286; sh: 9,394; perl: 7,442; ml: 5,494; awk: 3,523; makefile: 2,723; javascript: 1,206; xml: 886; fortran: 581; cs: 573
file content (54 lines) | stat: -rw-r--r-- 2,170 bytes parent folder | download | duplicates (2)
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
46
47
48
49
50
51
52
53
54
; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64le-unknown-unknown -mcpu=pwr9 | FileCheck  %s --check-prefixes=CHECK,CHECK64
; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc-ibm-aix-xcoff -mcpu=pwr9 -mattr=-altivec | FileCheck  %s --check-prefixes=CHECK,CHECK32
; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-ibm-aix-xcoff -mcpu=pwr9 -mattr=-altivec | FileCheck  %s --check-prefixes=CHECKAIX,CHECK64

define signext i32 @shrinkwrapme(i32 signext %a, i32 signext %lim) {
entry:
  %cmp5 = icmp sgt i32 %lim, 0
  br i1 %cmp5, label %for.body.preheader, label %for.cond.cleanup

 for.body.preheader:                               ; preds = %entry
  br label %for.body

 for.cond.cleanup.loopexit:                        ; preds = %for.body
  br label %for.cond.cleanup

 for.cond.cleanup:                                 ; preds = %for.cond.cleanup.loopexit, %entry
  %Ret.0.lcssa = phi i32 [ 0, %entry ], [ %0, %for.cond.cleanup.loopexit ]
  ret i32 %Ret.0.lcssa

 for.body:                                         ; preds = %for.body.preheader, %for.body
  %i.07 = phi i32 [ %inc, %for.body ], [ 0, %for.body.preheader ]
  %Ret.06 = phi i32 [ %0, %for.body ], [ 0, %for.body.preheader ]
  %0 = tail call i32 asm "add $0, $1, $2", "=r,r,r,~{r14},~{r15},~{r16},~{r17},~{r18},~{r19},~{r20},~{r21},~{r22},~{r23},~{r24},~{r25},~{r26},~{r27},~{r28},~{r29},~{r30},~{r31}"(i32 %a, i32 %Ret.06)
  %inc = add nuw nsw i32 %i.07, 1
  %exitcond = icmp eq i32 %inc, %lim
  br i1 %exitcond, label %for.cond.cleanup.loopexit, label %for.body

; CHECK-LABEL: {{[\.]?}}shrinkwrapme:
; CHECK:            # %bb.0:
; CHECK-NEXT:         cmpwi
; Prolog code
; CHECK64-COUNT-18:   std

; CHECK32-COUNT-18:   stw

; CHECK:              ble 0, {{.*}}BB0_3
; CHECKAIX:           blt 0, {{.*}}BB0_3
; CHECK:            # %bb.1:
; CHECK:              li
; CHECK:            {{.*}}BB0_2:
; CHECK:              add
; CHECK:              bdnz {{.*}}BB0_2
; CHECK-NEXT:         b {{.*}}BB0_4
; CHECK:            {{.*}}BB0_3:
; CHECK-NEXT:         li
; CHECK:            {{.*}}BB0_4:

; Epilog code
; CHECK64-COUNT-18:   ld
;
; CHECK32-COUNT-18:   lwz

; CHECK:              blr
}