[LoopFlatten] Move it from LPM2 to LPM1
authorSjoerd Meijer <sjoerd.meijer@arm.com>
Wed, 19 Jan 2022 14:09:59 +0000 (14:09 +0000)
committerSjoerd Meijer <sjoerd.meijer@arm.com>
Wed, 19 Jan 2022 14:38:05 +0000 (14:38 +0000)
commitf269ec230e2b65df165009b85f1e8cae2aeb1bba
tree391a436ea000989d4a42c8112d66b5bea061551b
parent016022e5daa821cf22fe3bcfb89878a21fe88937
[LoopFlatten] Move it from LPM2 to LPM1

In D110057 we moved LoopFlatten to a LoopPassManager. This caused a performance
regression for our 64-bit targets (the 32-bit were unaffected), the pass is no
longer triggering for a motivating example. The reason is that the IR is just
very different than expected; we try to match loop statements and particular
uses of induction variables. The easiest is to just move LoopFlatten to a place
in the pipeline where the IR is as expected, which is just before
IndVarSimplify. This means we move it from LPM2 to LPM1, so that it actually
runs just a bit earlier from where it was running before. IndVarSimplify is
responsible for significant rewrites that are difficult to "look through" in
LoopFlatten.

Differential Revision: https://reviews.llvm.org/D116612
llvm/lib/Passes/PassBuilderPipelines.cpp
llvm/test/Transforms/PhaseOrdering/AArch64/loopflatten.ll [new file with mode: 0644]