Enable runtime unrolling with unroll pragma metadata
authorMark Heffernan <meheff@google.com>
Mon, 13 Jul 2015 18:26:27 +0000 (18:26 +0000)
committerMark Heffernan <meheff@google.com>
Mon, 13 Jul 2015 18:26:27 +0000 (18:26 +0000)
commit8a9e01d606ce9954fcdc431ce3be3f7ae2411f38
tree1873024adb9d5c60325334fadb180f3b06a2fe79
parent8f5464d3abfc9cbadbb39b80825efed0d3b4a694
Enable runtime unrolling with unroll pragma metadata

Enable runtime unrolling for loops with unroll count metadata ("#pragma unroll N")
and a runtime trip count. Also, do not unroll loops with unroll full metadata if the
loop has a runtime loop count. Previously, such loops would be unrolled with a
very large threshold (pragma-unroll-threshold) if runtime unrolled happened to be
enabled resulting in a very large (and likely unwise) unroll factor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242047 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/LoopUnrollPass.cpp
test/Transforms/LoopUnroll/unroll-pragmas.ll