1 ; RUN: llc < %s -ppc-vsr-nums-as-vr -mtriple=powerpc64-unknown-linux-gnu \
2 ; RUN: -verify-machineinstrs -ppc-asm-full-reg-names -mcpu=pwr9 --ppc-enable-pipeliner \
3 ; RUN: -pass-remarks-analysis=pipeliner -pass-remarks=pipeliner -o /dev/null 2>&1 \
4 ; RUN: | FileCheck %s --check-prefix=ENABLED
5 ; RUN: llc < %s -ppc-vsr-nums-as-vr -mtriple=powerpc64-unknown-linux-gnu \
6 ; RUN: -verify-machineinstrs -ppc-asm-full-reg-names -mcpu=pwr8 --ppc-enable-pipeliner \
7 ; RUN: -pass-remarks-analysis=pipeliner -pass-remarks=pipeliner -o /dev/null 2>&1 \
8 ; RUN: | FileCheck %s --check-prefix=ENABLED
9 ; RUN: llc < %s -ppc-vsr-nums-as-vr -mtriple=powerpc64-unknown-linux-gnu \
10 ; RUN: -verify-machineinstrs -ppc-asm-full-reg-names -mcpu=pwr7 --ppc-enable-pipeliner \
11 ; RUN: -pass-remarks-analysis=pipeliner -pass-remarks=pipeliner -o /dev/null 2>&1 \
12 ; RUN: | FileCheck %s --allow-empty --check-prefix=ENABLED
14 @x = dso_local local_unnamed_addr global <{ i32, i32, i32, i32, [1020 x i32] }> <{ i32 1, i32 2, i32 3, i32 4, [1020 x i32] zeroinitializer }>, align 4
15 @y = dso_local global [1024 x i32] zeroinitializer, align 4
17 define dso_local ptr @foo() local_unnamed_addr {
18 ;ENABLED: Schedule found with Initiation Interval
19 ;ENABLED: Pipelined succesfully!
21 %.pre = load i32, ptr @y, align 4
24 for.cond.cleanup: ; preds = %for.body
27 for.body: ; preds = %for.body, %entry
28 %0 = phi i32 [ %.pre, %entry ], [ %add.2, %for.body ]
29 %indvars.iv = phi i64 [ 1, %entry ], [ %indvars.iv.next.2, %for.body ]
30 %arrayidx2 = getelementptr inbounds [1024 x i32], ptr @x, i64 0, i64 %indvars.iv
31 %1 = load i32, ptr %arrayidx2, align 4
32 %mul = mul nsw i32 %1, %1
33 %add = add nsw i32 %mul, %0
34 %arrayidx6 = getelementptr inbounds [1024 x i32], ptr @y, i64 0, i64 %indvars.iv
35 store i32 %add, ptr %arrayidx6, align 4
36 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
37 %arrayidx2.1 = getelementptr inbounds [1024 x i32], ptr @x, i64 0, i64 %indvars.iv.next
38 %2 = load i32, ptr %arrayidx2.1, align 4
39 %mul.1 = mul nsw i32 %2, %2
40 %add.1 = add nsw i32 %mul.1, %add
41 %arrayidx6.1 = getelementptr inbounds [1024 x i32], ptr @y, i64 0, i64 %indvars.iv.next
42 store i32 %add.1, ptr %arrayidx6.1, align 4
43 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
44 %arrayidx2.2 = getelementptr inbounds [1024 x i32], ptr @x, i64 0, i64 %indvars.iv.next.1
45 %3 = load i32, ptr %arrayidx2.2, align 4
46 %mul.2 = mul nsw i32 %3, %3
47 %add.2 = add nsw i32 %mul.2, %add.1
48 %arrayidx6.2 = getelementptr inbounds [1024 x i32], ptr @y, i64 0, i64 %indvars.iv.next.1
49 store i32 %add.2, ptr %arrayidx6.2, align 4
50 %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
51 %exitcond.2 = icmp eq i64 %indvars.iv.next.2, 1024
52 br i1 %exitcond.2, label %for.cond.cleanup, label %for.body