This UpperBound unrolling was already enabled so long as a series of conditions in ARMTTIImpl::getUnrollingPreferences pass. This just always enables it as it can help fully unroll loops that would not otherwise pass those tests.
Details
Diff Detail
Event Timeline
llvm/test/Transforms/LoopUnroll/ARM/upperbound.ll | ||
---|---|---|
78 | I find this test change a bit difficult to read. What exactly is changing here? |
llvm/test/Transforms/LoopUnroll/ARM/upperbound.ll | ||
---|---|---|
78 | It is getting fully unrolled, which combined with the array values becoming constant and known, managed to simplify most of the unrolled code away. I was just using it as an example of something that will now be unrolled beneficially. |
llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp | ||
---|---|---|
2121 | Looking at this again, I am now confused why we always want to enable this while.... | |
2130 | ... here we check of Oz and Os. So we could bail here, but still set UpperBound to true. Is that correct or what we want? | |
llvm/test/Transforms/LoopUnroll/ARM/upperbound.ll | ||
78 | Ah, okay, got it, cheers. |
llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp | ||
---|---|---|
2130 | The loop unroller will already handle Oz and Os correctly, and I think these values are already the same as the defaults it has. The loop unroller will only unroll loops if it thinks the size will be less after unrolling than the size of the loop. So very rarely, and usually only for loops with 1 or 2 iterations. UpperBound should not change that and should be safe to always enable. |
llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp | ||
---|---|---|
2130 | Okidoki, thanks, LGTM. |
Looking at this again, I am now confused why we always want to enable this while....