diff options
author | James Molloy <james.molloy@arm.com> | 2016-08-15 07:53:03 +0000 |
---|---|---|
committer | James Molloy <james.molloy@arm.com> | 2016-08-15 07:53:03 +0000 |
commit | 196ad0823e67bffef39983fbd9d7c13fb25911b6 (patch) | |
tree | 9bdc1e2cbd6c94f8f75a6304847c91a206b6b7fe /llvm/lib/CodeGen/MachineLoopInfo.cpp | |
parent | a5c8a685356a5c5e956723429f7c2c39f8fbcd37 (diff) | |
download | llvm-196ad0823e67bffef39983fbd9d7c13fb25911b6.zip llvm-196ad0823e67bffef39983fbd9d7c13fb25911b6.tar.gz llvm-196ad0823e67bffef39983fbd9d7c13fb25911b6.tar.bz2 |
[LSR] Don't try and create post-inc expressions on non-rotated loops
If a loop is not rotated (for example when optimizing for size), the latch is not the backedge. If we promote an expression to post-inc form, we not only increase register pressure and add a COPY for that IV expression but for all IVs!
Motivating testcase:
void f(float *a, float *b, float *c, int n) {
while (n-- > 0)
*c++ = *a++ + *b++;
}
It's imperative that the pointer increments be located in the latch block and not the header block; if not, we cannot use post-increment loads and stores and we have to keep both the post-inc and pre-inc values around until the end of the latch which bloats register usage.
llvm-svn: 278658
Diffstat (limited to 'llvm/lib/CodeGen/MachineLoopInfo.cpp')
0 files changed, 0 insertions, 0 deletions