This is an archive of the discontinued LLVM Phabricator instance.

[LoopReroller] Allow setting MaxRerollIterations above 16
ClosedPublic

Authored by Ayal on Feb 15 2016, 1:58 AM.

Details

Reviewers
jmolloy
hfinkel
Summary

LoopReroller currently handles upto 16 iterations and this threshold is hardwired. Using a larger threshold will work, although if set to more than 25 or so the SmallBitVectors used will run slower. This patch exports -max-rerolled-iterations flag to the command line, to allow setting a larger (than 16) threshold if interested. Regretfully, couldn’t find a better way to keep the Iteration Limit constants neatly together as they were, and yet allow to override them.

Diff Detail

Event Timeline

Ayal updated this revision to Diff 47961.Feb 15 2016, 1:58 AM
Ayal retitled this revision from to [LoopReroller] Allow setting MaxRerollIterations above 16.
Ayal updated this object.
Ayal added reviewers: jmolloy, hfinkel.
Ayal added a subscriber: llvm-commits.
jmolloy edited edge metadata.Feb 15 2016, 8:04 AM

Hi,

I think this is unnecessarily complex. Can't we just switch from a SmallBitVector to a BitVector and set IL_MaxIterations to 32? or do you need it larger than that?

James

Ayal added a comment.Feb 16 2016, 10:13 AM

We can surely switch from a SmallBitVector to a BitVector and set IL_MaxIterations to 32, and that may indeed suite all current interests (and simplify the patch). But given externally adjustable thresholds like reroll-num-tolerated-failed-matches and max-reroll-increment it seems natural to allow resetting max-reroll-iterations externally as well, no?

Ayal updated this revision to Diff 48637.Feb 21 2016, 2:44 PM
Ayal edited edge metadata.

Re-fixing IL_MaxRerollIterations to 32 as asked.
ok?

jmolloy accepted this revision.Feb 22 2016, 12:34 AM
jmolloy edited edge metadata.

Yep, looks good, thanks!

Sorry I didn't reply to your previous comment. Essentially yes, I agree that tuning this on the command line would be nice. However, the way proposed made the code look ugly and less readable.

James

This revision is now accepted and ready to land.Feb 22 2016, 12:34 AM
Eugene.Zelenko added a subscriber: Eugene.Zelenko.

Committed in r261517.