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.
Details
Diff Detail
Event Timeline
Update unrolling behavior for unroll(full) directive as discussed in http://reviews.llvm.org/D10857.
Hal,
From your earlier comments it wasn't clear whether you were suggesting that
the front end should add unroll.full and unroll.disable.runtime metadata
with "#pragma unroll" OR if unroll.full metadata should imply no runtime
unrolling in the optimizer. I opted for the latter. It seemed more natural
for the front-end just to do a straight-forward map of the directives to
metadata, and then the optimizer has the logic to properly deal with funny
cases like pragma unroll on a runtime trip count loop.
Mark
Yes, makes sense to me. Specifically requesting full unrolling on a loop with a non-static trip count does not make sense, and the optimizer should ignore it.
Mark