[IEPM] don't preserve lexical blocks just for debug inline markers
commit1d74f6b12b4b81069ec6f7a880e489b18fae2c16
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 27 Feb 2018 03:37:10 +0000 (27 03:37 +0000)
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 27 Feb 2018 03:37:10 +0000 (27 03:37 +0000)
tree85cc7bd6adb42b040f959121d5f5e438d796e982
parentbb85f261db744c5fc71fcaa2ebc4219d1a1a3887
[IEPM] don't preserve lexical blocks just for debug inline markers

This patch stops preserving scope blocks just because they are inlined
function scopes, when cleaning up unused scope blocks.  This change
was introduced along with IEPM, but it preserved lots of blocks, and
output debug information for them, although no code from the inlined
function remained after optimization.

The additional preserved blocks took up compile-time memory, and
significant disk space and link time, in some cases more than 25%.
This is deemed excessive, compared with the reasonably small benefit
of allowing one to single-step into an inlined function using a
view-capable debugger.

There was another way of marking inlined function scopes as unused,
based on the markers referencing them during stmt scanning, but that
still preserved too much.

So, this patch restores the pre-IEPM logic of preservation of scopes.
Should a scope block referenced by an inline entry marker be found to
be unused in remove_unused_scope_block_p, the marker will be cleaned
up right after that, in clear_unused_block_pointer, so we won't keep
a dangling reference to a dropped block.

for  gcc/ChangeLog

* tree-ssa-live.c (remove_unused_scope_block_p): Do not
preserve inline entry blocks for the sake of debug inline
entry point markers alone.
(remove_unused_locals): Suggest in comments a better place to
force the preservation of inline entry blocks that are
otherwise unused, but do not preserve them.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@258026 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/tree-ssa-live.c