summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/LoopUnroll/runtime-li.ll
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2019-04-17 04:52:47 +0000
committerEric Christopher <echristo@gmail.com>2019-04-17 04:52:47 +0000
commitcee313d288a4faf0355d76fb6e0e927e211d08a5 (patch)
treed386075318d761197779a96e5d8fc0dc7b06342b /llvm/test/Transforms/LoopUnroll/runtime-li.ll
parentc3d6a929fdd92fd06d4304675ade8d7210ee711a (diff)
downloadbcm5719-llvm-cee313d288a4faf0355d76fb6e0e927e211d08a5.tar.gz
bcm5719-llvm-cee313d288a4faf0355d76fb6e0e927e211d08a5.zip
Revert "Temporarily Revert "Add basic loop fusion pass.""
The reversion apparently deleted the test/Transforms directory. Will be re-reverting again. llvm-svn: 358552
Diffstat (limited to 'llvm/test/Transforms/LoopUnroll/runtime-li.ll')
-rw-r--r--llvm/test/Transforms/LoopUnroll/runtime-li.ll36
1 files changed, 36 insertions, 0 deletions
diff --git a/llvm/test/Transforms/LoopUnroll/runtime-li.ll b/llvm/test/Transforms/LoopUnroll/runtime-li.ll
new file mode 100644
index 00000000000..5494c8e9da7
--- /dev/null
+++ b/llvm/test/Transforms/LoopUnroll/runtime-li.ll
@@ -0,0 +1,36 @@
+; RUN: opt -S -loop-unroll -unroll-runtime -unroll-count=2 -verify-loop-info -pass-remarks=loop-unroll < %s 2>&1 | FileCheck %s
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+; Verify that runtime-unrolling a top-level loop that has nested loops does not
+; make the unroller produce invalid loop-info.
+; CHECK: remark: {{.*}}: unrolled loop by a factor of 2 with run-time trip count
+; CHECK: @widget
+; CHECK: ret void
+define void @widget(double* %arg, double* %arg1, double* %p, i64* %q1, i64* %q2) local_unnamed_addr {
+entry:
+ br label %header.outer
+
+header.outer: ; preds = %latch.outer, %entry
+ %tmp = phi double* [ %tmp8, %latch.outer ], [ %arg, %entry ]
+ br label %header.inner
+
+header.inner: ; preds = %latch.inner, %header.outer
+ br i1 undef, label %latch.inner, label %latch.outer
+
+latch.inner: ; preds = %header.inner
+ %tmp5 = load i64, i64* %q1, align 8
+ store i64 %tmp5, i64* %q2, align 8
+ %tmp6 = icmp eq double* %p, %arg
+ br label %header.inner
+
+latch.outer: ; preds = %header.inner
+ store double 0.0, double* %p, align 8
+ %tmp8 = getelementptr inbounds double, double* %tmp, i64 1
+ %tmp9 = icmp eq double* %tmp8, %arg1
+ br i1 %tmp9, label %exit, label %header.outer
+
+exit: ; preds = %latch.outer
+ ret void
+}
OpenPOWER on IntegriCloud