1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr9 -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK,V01,CHECK-V0
3 ; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr9 -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK,V01,CHECK-V1
4 ; RUN: llc < %s -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr8 -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK,V23,CHECK-V2
5 ; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK,V23,CHECK-V3
7 ; Function Attrs: norecurse nounwind readonly
8 define signext i32 @limit_loop(i32 signext %iters, ptr nocapture readonly %vec, i32 signext %limit) local_unnamed_addr {
9 ; V01-LABEL: limit_loop:
10 ; V01: # %bb.0: # %entry
13 ; V01-NEXT: cmpwi 6, 0
15 ; V01-NEXT: # %bb.1: # %for.body.preheader
17 ; V01-NEXT: addi 4, 4, -4
19 ; V01-NEXT: .p2align 4
20 ; V01-NEXT: .LBB0_2: # %for.cond
23 ; V01-NEXT: .LBB0_3: # %for.body
25 ; V01-NEXT: lwzu 6, 4(4)
27 ; V01-NEXT: blt 0, .LBB0_2
32 ; V23-LABEL: limit_loop:
33 ; V23: # %bb.0: # %entry
36 ; V23-NEXT: cmpwi 6, 0
38 ; V23-NEXT: # %bb.1: # %for.body.preheader
39 ; V23-NEXT: addi 4, 4, -4
42 ; V23-NEXT: .p2align 4
43 ; V23-NEXT: .LBB0_2: # %for.cond
46 ; V23-NEXT: .LBB0_3: # %for.body
48 ; V23-NEXT: lwzu 6, 4(4)
50 ; V23-NEXT: blt 0, .LBB0_2
55 %cmp5 = icmp sgt i32 %iters, 0
56 br i1 %cmp5, label %for.body.preheader, label %cleanup
58 for.body.preheader: ; preds = %entry
59 %0 = sext i32 %iters to i64
62 for.cond: ; preds = %for.body
63 %cmp = icmp slt i64 %indvars.iv.next, %0
64 br i1 %cmp, label %for.body, label %cleanup
66 for.body: ; preds = %for.body.preheader, %for.cond
67 %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.cond ]
68 %arrayidx = getelementptr inbounds i32, ptr %vec, i64 %indvars.iv
69 %1 = load i32, ptr %arrayidx, align 4
70 %cmp1 = icmp slt i32 %1, %limit
71 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
72 br i1 %cmp1, label %for.cond, label %cleanup
74 cleanup: ; preds = %for.body, %for.cond, %entry
75 %2 = phi i32 [ 0, %entry ], [ 0, %for.cond ], [ 1, %for.body ]
80 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: