[Pipelines] Restore old DAE position in LTO pipeline
authorNikita Popov <npopov@redhat.com>
Tue, 14 Mar 2023 14:26:41 +0000 (15:26 +0100)
committerNikita Popov <npopov@redhat.com>
Tue, 14 Mar 2023 16:00:17 +0000 (17:00 +0100)
commitfb5683449e97bd8c2d107128dcf08d6f93789315
tree37c5a4ff093c3190bb3748b3229876471f8dc1a9
parentd9db5a5904fd328130a5dd100e3cf36eb7d9e6d0
[Pipelines] Restore old DAE position in LTO pipeline

This is a partial revert of D128830, restoring the previous
position of DeadArgElim in the fat LTO pipeline. The motivation
for this is a major code size regression observed in Rust and
illustrated in the PhaseOrdering test.

This is a conservative fix restoring the previous pipeline order.
The real problem is that the LTO pipeline is conceptually broken:
It doesn't have a CGSCC function simplification pipeline. The
inliner is just being run by itself. This wouldn't be a problem
if fat LTO used a standard design where ArgPromotion and DAE are
only run after functions have already been simplified by the
CGSCC inliner pipeline.

Differential Revision: https://reviews.llvm.org/D146051
llvm/lib/Passes/PassBuilderPipelines.cpp
llvm/test/Other/new-pm-lto-defaults.ll
llvm/test/Transforms/PhaseOrdering/dae-dce.ll