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.
Details
Diff Detail
Event Timeline
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). |
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. |
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).