[ARM] Limit v6m unrolling with multiple live outs
authorDavid Green <david.green@arm.com>
Wed, 23 Jun 2021 15:36:37 +0000 (16:36 +0100)
committerDavid Green <david.green@arm.com>
Wed, 23 Jun 2021 15:36:37 +0000 (16:36 +0100)
commit8cfc08013299d873edd364436aa78e7effb28dd4
tree977a3c85371692428e4ad8960854e43d57513bd2
parentad0085d3381a28041244fe6847f6ac1ce8dd052e
[ARM] Limit v6m unrolling with multiple live outs

v6m cores only have a limited number of registers available. Unrolling
can mean we spend more on stack spills and reloads than we save from the
unrolling. This patch adds an extra heuristic to put a limit on the
unroll count for loops with multiple live out values, as measured from
the LCSSA phi nodes.

Differential Revision: https://reviews.llvm.org/D104659
llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
llvm/test/Transforms/LoopUnroll/ARM/v6munroll.ll [new file with mode: 0644]