OSDN Git Service

Add -unroll-runtime for unrolling loops with run-time trip counts.
authorAndrew Trick <atrick@apple.com>
Fri, 9 Dec 2011 06:19:40 +0000 (06:19 +0000)
committerAndrew Trick <atrick@apple.com>
Fri, 9 Dec 2011 06:19:40 +0000 (06:19 +0000)
commit5d73448bb7f3d326f310e6f35030821b103b1cdb
tree559f8f027346d2270472463686fa54187721d8d5
parent9c181a92d8bc7af36839520c3e145bf11a6193fa
Add -unroll-runtime for unrolling loops with run-time trip counts.

Patch by Brendon Cahoon!

This extends the existing LoopUnroll and LoopUnrollPass. Brendon
measured no regressions in the llvm test suite with -unroll-runtime
enabled. This implementation works by using the existing loop
unrolling code to unroll the loop by a power-of-two (default 8). It
generates an if-then-else sequence of code prior to the loop to
execute the extra iterations before entering the unrolled loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146245 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Transforms/Utils/UnrollLoop.h
lib/Transforms/Scalar/LoopUnrollPass.cpp
lib/Transforms/Utils/CMakeLists.txt
lib/Transforms/Utils/LoopUnroll.cpp
lib/Transforms/Utils/LoopUnrollRuntime.cpp [new file with mode: 0644]
test/Transforms/LoopUnroll/runtime-loop.ll [new file with mode: 0644]
test/Transforms/LoopUnroll/runtime-loop1.ll [new file with mode: 0644]
test/Transforms/LoopUnroll/runtime-loop2.ll [new file with mode: 0644]
test/Transforms/LoopUnroll/runtime-loop3.ll [new file with mode: 0644]