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 --allow-empty --check-prefix=DISABLED
10 @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
11 @y = dso_local global [1024 x i32] zeroinitializer, align 4
13 define dso_local i32* @foo() local_unnamed_addr {
14 ;ENABLED: Schedule found with Initiation Interval
15 ;ENABLED: Pipelined succesfully!
18 %.pre = load i32, i32* getelementptr inbounds ([1024 x i32], [1024 x i32]* @y, i64 0, i64 0), align 4
21 for.cond.cleanup: ; preds = %for.body
22 ret i32* getelementptr inbounds ([1024 x i32], [1024 x i32]* @y, i64 0, i64 0)
24 for.body: ; preds = %for.body, %entry
25 %0 = phi i32 [ %.pre, %entry ], [ %add.2, %for.body ]
26 %indvars.iv = phi i64 [ 1, %entry ], [ %indvars.iv.next.2, %for.body ]
27 %arrayidx2 = getelementptr inbounds [1024 x i32], [1024 x i32]* bitcast (<{ i32, i32, i32, i32, [1020 x i32] }>* @x to [1024 x i32]*), i64 0, i64 %indvars.iv
28 %1 = load i32, i32* %arrayidx2, align 4
29 %mul = mul nsw i32 %1, %1
30 %add = add nsw i32 %mul, %0
31 %arrayidx6 = getelementptr inbounds [1024 x i32], [1024 x i32]* @y, i64 0, i64 %indvars.iv
32 store i32 %add, i32* %arrayidx6, align 4
33 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
34 %arrayidx2.1 = getelementptr inbounds [1024 x i32], [1024 x i32]* bitcast (<{ i32, i32, i32, i32, [1020 x i32] }>* @x to [1024 x i32]*), i64 0, i64 %indvars.iv.next
35 %2 = load i32, i32* %arrayidx2.1, align 4
36 %mul.1 = mul nsw i32 %2, %2
37 %add.1 = add nsw i32 %mul.1, %add
38 %arrayidx6.1 = getelementptr inbounds [1024 x i32], [1024 x i32]* @y, i64 0, i64 %indvars.iv.next
39 store i32 %add.1, i32* %arrayidx6.1, align 4
40 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
41 %arrayidx2.2 = getelementptr inbounds [1024 x i32], [1024 x i32]* bitcast (<{ i32, i32, i32, i32, [1020 x i32] }>* @x to [1024 x i32]*), i64 0, i64 %indvars.iv.next.1
42 %3 = load i32, i32* %arrayidx2.2, align 4
43 %mul.2 = mul nsw i32 %3, %3
44 %add.2 = add nsw i32 %mul.2, %add.1
45 %arrayidx6.2 = getelementptr inbounds [1024 x i32], [1024 x i32]* @y, i64 0, i64 %indvars.iv.next.1
46 store i32 %add.2, i32* %arrayidx6.2, align 4
47 %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
48 %exitcond.2 = icmp eq i64 %indvars.iv.next.2, 1024
49 br i1 %exitcond.2, label %for.cond.cleanup, label %for.body