summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/LoopUnroll/runtime-loop2.ll
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2015-01-10 00:30:55 +0000
committerHal Finkel <hfinkel@anl.gov>2015-01-10 00:30:55 +0000
commit38dd590861c32563c3bb38bc8ca53055fc89d691 (patch)
tree96054acf3ba7dfc69f16122ffe9b249a389ac53f /llvm/test/Transforms/LoopUnroll/runtime-loop2.ll
parent0f1b4997cef22f3a8a0798a4a253d0db38d8735d (diff)
downloadbcm5719-llvm-38dd590861c32563c3bb38bc8ca53055fc89d691.tar.gz
bcm5719-llvm-38dd590861c32563c3bb38bc8ca53055fc89d691.zip
[LoopUnroll] Fix the partial unrolling threshold for small loop sizes
When we compute the size of a loop, we include the branch on the backedge and the comparison feeding the conditional branch. Under normal circumstances, these don't get replicated with the rest of the loop body when we unroll. This led to the somewhat surprising behavior that really small loops would not get unrolled enough -- they could be unrolled more and the resulting loop would be below the threshold, because we were assuming they'd take (LoopSize * UnrollingFactor) instructions after unrolling, instead of (((LoopSize-2) * UnrollingFactor)+2) instructions. This fixes that computation. llvm-svn: 225565
Diffstat (limited to 'llvm/test/Transforms/LoopUnroll/runtime-loop2.ll')
-rw-r--r--llvm/test/Transforms/LoopUnroll/runtime-loop2.ll2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/test/Transforms/LoopUnroll/runtime-loop2.ll b/llvm/test/Transforms/LoopUnroll/runtime-loop2.ll
index 7205c686065..176362a3445 100644
--- a/llvm/test/Transforms/LoopUnroll/runtime-loop2.ll
+++ b/llvm/test/Transforms/LoopUnroll/runtime-loop2.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -S -loop-unroll -unroll-threshold=50 -unroll-runtime -unroll-count=8 | FileCheck %s
+; RUN: opt < %s -S -loop-unroll -unroll-threshold=25 -unroll-runtime -unroll-count=8 | FileCheck %s
; Choose a smaller, power-of-two, unroll count if the loop is too large.
; This test makes sure we're not unrolling 'odd' counts
OpenPOWER on IntegriCloud