This is an archive of the discontinued LLVM Phabricator instance.

Disable loop re-rotation for -Oz
ClosedPublic

Authored by aturetsk on Jul 6 2015, 7:50 AM.

Details

Summary

After changes in rL231820 loop re-rotation is performed even in -Oz mode. Since loop rotation is disabled for -Oz, it seems loop re-rotation should be disabled too.

Diff Detail

Event Timeline

aturetsk updated this revision to Diff 29084.Jul 6 2015, 7:50 AM
aturetsk retitled this revision from to Disable loop re-rotation for -Oz.
aturetsk updated this object.
aturetsk added a reviewer: chandlerc.
aturetsk added a subscriber: llvm-commits.

Hi Andrey,

The change looks good to me, but I think the test might be slightly improved. You could commit the patch with this addressed.

Thanks,
Michael

Transforms/LoopRotate/oz-disable.ll
5–8

This check could be easily broken. A lot of stuff can happen to this loop when all passes are done, a simple example - the loop can be unrolled by 2, and then this check will fail.

I'd suggest we either check more specific regexps here, or just check debug output (add -debug -debug-only=loop-rotate and REQUIRES: asserts).

hfinkel added a subscriber: hfinkel.Jul 8 2015, 9:38 PM
hfinkel added inline comments.
lib/Transforms/IPO/PassManagerBuilder.cpp
322

This comment is misleading. The rotation is not disabled at -Oz, it is header duplication that is disabled. The comment above the first invocation says:

// Rotate Loop - disable header duplication at -Oz

we should be specific here too about what is being disabled.

aturetsk updated this revision to Diff 29432.Jul 10 2015, 1:41 AM

Hi Michael and Hal,

Thanks for the review.
I've fixed the test and the comment.

hfinkel accepted this revision.Jul 10 2015, 2:55 AM
hfinkel added a reviewer: hfinkel.

LGTM.

This revision is now accepted and ready to land.Jul 10 2015, 2:55 AM
This revision was automatically updated to reflect the committed changes.