• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64le-unknown-unknown -mcpu=pwr9 | FileCheck  %s
2define signext i32 @shrinkwrapme(i32 signext %a, i32 signext %lim) {
3entry:
4  %cmp5 = icmp sgt i32 %lim, 0
5  br i1 %cmp5, label %for.body.preheader, label %for.cond.cleanup
6
7 for.body.preheader:                               ; preds = %entry
8  br label %for.body
9
10 for.cond.cleanup.loopexit:                        ; preds = %for.body
11  br label %for.cond.cleanup
12
13 for.cond.cleanup:                                 ; preds = %for.cond.cleanup.loopexit, %entry
14  %Ret.0.lcssa = phi i32 [ 0, %entry ], [ %0, %for.cond.cleanup.loopexit ]
15  ret i32 %Ret.0.lcssa
16
17 for.body:                                         ; preds = %for.body.preheader, %for.body
18  %i.07 = phi i32 [ %inc, %for.body ], [ 0, %for.body.preheader ]
19  %Ret.06 = phi i32 [ %0, %for.body ], [ 0, %for.body.preheader ]
20  %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)
21  %inc = add nuw nsw i32 %i.07, 1
22  %exitcond = icmp eq i32 %inc, %lim
23  br i1 %exitcond, label %for.cond.cleanup.loopexit, label %for.body
24
25; CHECK-LABEL: shrinkwrapme
26; CHECK:       # %bb.0:
27; CHECK-NEXT:    cmpwi
28; Prolog code
29; CHECK:         std
30; CHECK:         std
31; CHECK:         std
32; CHECK:         std
33; CHECK:         blt 0, .LBB0_3
34; CHECK:       # %bb.1:
35; CHECK-NEXT:    clrldi
36; CHECK-NEXT:    mtctr
37; CHECK-NEXT:    li
38; CHECK:       .LBB0_2:
39; CHECK:         add
40; CHECK:         bdnz .LBB0_2
41; CHECK-NEXT:    b .LBB0_4
42; CHECK:       .LBB0_3:
43; CHECK-NEXT:    li
44; CHECK:       .LBB0_4:
45; Epilog code
46; CHECK:         ld
47; CHECK:         ld
48; CHECK:         extsw
49; CHECK:         ld
50; CHECK:         ld
51; CHECK:         blr
52}
53