This is an archive of the discontinued LLVM Phabricator instance.

Reduce unroll of constant bounds loop with TripCount that is not modulo of unroll factor.
AcceptedPublic

Authored by evstupac on Apr 4 2016, 6:23 PM.

Details

Summary

Allow the type of unroll only when AllowRuntime is true.
Limit Count to DefaultRuntimeCount.

Diff Detail

Repository
rL LLVM

Event Timeline

evstupac updated this revision to Diff 52651.Apr 4 2016, 6:23 PM
evstupac retitled this revision from to Reduce unroll of constant bounds loop with TripCount that is not modulo of unroll factor..
evstupac updated this object.
evstupac added reviewers: mzolotukhin, resistor, escha.
evstupac set the repository for this revision to rL LLVM.
evstupac added a subscriber: llvm-commits.
escha accepted this revision.Apr 4 2016, 9:57 PM
escha edited edge metadata.

LGTM

This revision is now accepted and ready to land.Apr 4 2016, 9:57 PM
zansari added a subscriber: zansari.Apr 6 2016, 2:32 PM

I'd prefer we used a different way to control this, like perhaps another option.

The way it is now overloads the documented meaning of "-unroll-runtime", which may be confusing and undesirable/restricting.

For example, if I disable -unroll-runtime to stop unrolling loops that don't have compile time constants (as it's documented to do), with this patch, I'll also stop some loops that DO have compile time constants from being unrolled.

We need to either re-purpose that option, or introduce a new one. I'd prefer the latter for minimal impact.

Zia.