diff options
author | Jan Hubicka <jh@suse.cz> | 2023-06-28 23:05:28 +0200 |
---|---|---|
committer | Jan Hubicka <jh@suse.cz> | 2023-06-28 23:06:18 +0200 |
commit | d88fd2e1d0720e6f892da9ff48e9a301a7ad0ad4 (patch) | |
tree | cc88e993b5c20eb13f41e991dbb43e6bfc77ade8 /gcc/ada/gcc-interface/decl.cc | |
parent | 8736d6b14a4dfdfb58c80ccd398981b0fb5d00aa (diff) | |
download | gcc-d88fd2e1d0720e6f892da9ff48e9a301a7ad0ad4.zip gcc-d88fd2e1d0720e6f892da9ff48e9a301a7ad0ad4.tar.gz gcc-d88fd2e1d0720e6f892da9ff48e9a301a7ad0ad4.tar.bz2 |
Enable early inlining into always_inline functions
Early inliner currently skips always_inline functions and moreover we ignore
calls from always_inline in ipa_reverse_postorder. This leads to disabling
most of propagation done using early optimization that is quite bad when
early inline functions are not leaf functions, which is now quite common
in libstdc++.
This patch instead of fully disabling the inline checks calls in callee.
I am quite conservative about what can be inlined as this patch is bit
touchy anyway. To avoid problems with always_inline being optimized
after early inline I extended inline_always_inline_functions to lazilly
compute fnsummary when needed.
gcc/ChangeLog:
PR middle-end/110334
* ipa-fnsummary.h (ipa_fn_summary): Add
safe_to_inline_to_always_inline.
* ipa-inline.cc (can_early_inline_edge_p): ICE
if SSA is not built; do cycle checking for
always_inline functions.
(inline_always_inline_functions): Be recrusive;
watch for cycles; do not updat overall summary.
(early_inliner): Do not give up on always_inlines.
* ipa-utils.cc (ipa_reverse_postorder): Do not skip
always inlines.
gcc/testsuite/ChangeLog:
PR middle-end/110334
* g++.dg/opt/pr66119.C: Disable early inlining.
* gcc.c-torture/compile/pr110334.c: New test.
* gcc.dg/tree-ssa/pr110334.c: New test.
Diffstat (limited to 'gcc/ada/gcc-interface/decl.cc')
0 files changed, 0 insertions, 0 deletions