summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2013-05-16 16:52:41 +0000
committerHal Finkel <hfinkel@anl.gov>2013-05-16 16:52:41 +0000
commit2a5e8c328eb0d957f00190c0c6189a4f1fef1117 (patch)
tree2c7289bb9b2283f5de88b99124ff98623f157dcc /test
parent3e521a5223e548748725c8b19d964d8e6de4fc82 (diff)
downloadllvm-2a5e8c328eb0d957f00190c0c6189a4f1fef1117.tar.gz
llvm-2a5e8c328eb0d957f00190c0c6189a4f1fef1117.tar.bz2
llvm-2a5e8c328eb0d957f00190c0c6189a4f1fef1117.tar.xz
PPC32 cannot form counter loops around i64 FP conversions
On PPC32, i64 FP conversions are implemented using runtime calls (which clobber the counter register). These must be excluded. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182023 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/PowerPC/ctrloop-fp64.ll28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/CodeGen/PowerPC/ctrloop-fp64.ll b/test/CodeGen/PowerPC/ctrloop-fp64.ll
new file mode 100644
index 0000000000..78974248da
--- /dev/null
+++ b/test/CodeGen/PowerPC/ctrloop-fp64.ll
@@ -0,0 +1,28 @@
+; RUN: llc < %s -mcpu=generic | FileCheck %s
+
+target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v128:128:128-n32"
+target triple = "powerpc-unknown-linux-gnu"
+
+define i64 @foo(double* nocapture %n) nounwind readonly {
+entry:
+ br label %for.body
+
+for.body: ; preds = %for.body, %entry
+ %i.06 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
+ %x.05 = phi i64 [ 0, %entry ], [ %conv1, %for.body ]
+ %arrayidx = getelementptr inbounds double* %n, i32 %i.06
+ %0 = load double* %arrayidx, align 8
+ %conv = sitofp i64 %x.05 to double
+ %add = fadd double %conv, %0
+ %conv1 = fptosi double %add to i64
+ %inc = add nsw i32 %i.06, 1
+ %exitcond = icmp eq i32 %inc, 2048
+ br i1 %exitcond, label %for.end, label %for.body
+
+for.end: ; preds = %for.body
+ ret i64 %conv1
+}
+
+; CHECK: @foo
+; CHECK-NOT: mtctr
+