[PassManager] Move load/store motion pass after DSE in LTO pipeline.
authorFlorian Hahn <flo@fhahn.com>
Thu, 3 Sep 2020 11:30:36 +0000 (12:30 +0100)
committerFlorian Hahn <flo@fhahn.com>
Thu, 3 Sep 2020 12:47:50 +0000 (13:47 +0100)
commit6de51189b07bbae853cc7c053dfb5f383c308c76
treea4806f9e99716fa2f1324ba1c6a4d60d43cd013d
parent9f18f3c858d5ff8154701a50c2be6f7b19667a1d
[PassManager] Move load/store motion pass after DSE in LTO pipeline.

As far as I am aware, the placement of MergedLoadStoreMotion in the
pipeline is not heavily tuned currently. It seems to not matter much if
we do it after DSE in the LTO pipeline (no binary changes for -O3 -flto
on MultiSource/SPEC2000/SPEC2006). Moving it after DSE however has a
major benefit: MemorySSA is constructed by LICM and is consumed by DSE,
so if MergedLoadStoreMotion happens after DSE, we do not need to
preserve MemorySSA in it.

If there are any concerns with this move, I can also update
MergedLoadStoreMotion to preserve MemorySSA.

This patch together with D86651 (preserve MemSSA in MemCpyOpt) and
D86534 (preserve MemSSA in GVN) are the remaining patches to bring down
compile-time for DSE + MemorySSA to the levels outlined in
http://lists.llvm.org/pipermail/llvm-dev/2020-August/144417.html

Once they land, we should be able to start with flipping the switch on
enabling DSE + MmeorySSA.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D86967
llvm/lib/Transforms/IPO/PassManagerBuilder.cpp