diff options
author | Hal Finkel <hfinkel@anl.gov> | 2015-04-11 00:33:08 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2015-04-11 00:33:08 +0000 |
commit | ffb460fdf08a5e4c85c82d34e683e85ab0102784 (patch) | |
tree | 2e688c0af53f69fbd6675a09dddbb7abf685b528 /llvm/test/CodeGen/PowerPC/pip-inner.ll | |
parent | eb9bdb5d1686cc1e55d45fee419f1d07124d915e (diff) | |
download | bcm5719-llvm-ffb460fdf08a5e4c85c82d34e683e85ab0102784.tar.gz bcm5719-llvm-ffb460fdf08a5e4c85c82d34e683e85ab0102784.zip |
[PowerPC] Fix PPCLoopPreIncPrep for depth > 1 loops
This pass had the same problem as the data-prefetching pass: it was only
checking for depth == 1 loops in practice. Fix that, add some debugging
statements, and make sure that, when we grab an AddRec, it is for the loop we
expect.
llvm-svn: 234670
Diffstat (limited to 'llvm/test/CodeGen/PowerPC/pip-inner.ll')
-rw-r--r-- | llvm/test/CodeGen/PowerPC/pip-inner.ll | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/PowerPC/pip-inner.ll b/llvm/test/CodeGen/PowerPC/pip-inner.ll new file mode 100644 index 00000000000..930f0d37147 --- /dev/null +++ b/llvm/test/CodeGen/PowerPC/pip-inner.ll @@ -0,0 +1,52 @@ +; RUN: llc < %s | FileCheck %s +target datalayout = "E-m:e-i64:64-n32:64" +target triple = "powerpc64-unknown-linux-gnu" + +; Function Attrs: nounwind +define void @foo(double* %x, double* nocapture readonly %y) #0 { +entry: + br label %for.cond1.preheader + +for.cond1.preheader: ; preds = %for.end, %entry + %i.015 = phi i32 [ 0, %entry ], [ %inc7, %for.end ] + br label %for.body3 + +for.body3: ; preds = %for.body3, %for.cond1.preheader + %indvars.iv = phi i64 [ 0, %for.cond1.preheader ], [ %indvars.iv.next, %for.body3 ] + %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv + %0 = load double, double* %arrayidx, align 8 + %add = fadd double %0, 1.000000e+00 + %arrayidx5 = getelementptr inbounds double, double* %x, i64 %indvars.iv + store double %add, double* %arrayidx5, align 8 + %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 + %exitcond = icmp eq i64 %indvars.iv.next, 16000 + br i1 %exitcond, label %for.end, label %for.body3 + +for.end: ; preds = %for.body3 + tail call void @bar(double* %x) #2 + %inc7 = add nuw nsw i32 %i.015, 1 + %exitcond16 = icmp eq i32 %inc7, 1000 + br i1 %exitcond16, label %for.end8, label %for.cond1.preheader + +for.end8: ; preds = %for.end + ret void + +; CHECK-LABEL: @foo + +; CHECK: lfdu [[REG1:[0-9]+]], 8({{[0-9]+}}) +; CHECK: fadd [[REG2:[0-9]+]], [[REG1]], {{[0-9]+}} +; CHECK: stfdu [[REG2]], 8({{[0-9]+}}) +; CHECK: bdnz + +; CHECK: bl bar +; CHECK-NEXT: nop + +; CHECK: blr +} + +declare void @bar(double*) #1 + +attributes #0 = { nounwind "target-cpu"="a2" } +attributes #1 = { "target-cpu"="a2" } +attributes #2 = { nounwind } + |