[PR 89330] Remove non-useful speculations from new_edges
authorMartin Jambor <mjambor@suse.cz>
Fri, 26 Jul 2019 08:44:51 +0000 (10:44 +0200)
committerMartin Jambor <jamborm@gcc.gnu.org>
Fri, 26 Jul 2019 08:44:51 +0000 (10:44 +0200)
commit4517b378af6b412e053e8927972434d8580162d0
tree8ba242b52d8258623593e284cd0ffb7d7618141e
parentac2dca4daf516c6972df1f5ef66e64b3c8f12bc2
[PR 89330] Remove non-useful speculations from new_edges

2019-07-26  Martin Jambor  <mjambor@suse.cz>

PR ipa/89330
* ipa-inline-transform.c (check_speculations_1): New function.
(push_all_edges_in_set_to_vec): Likewise.
(check_speculations): Use check_speculations_1, new parameter
new_edges.
(inline_call): Pass new_edges to check_speculations.
* ipa-inline.c (add_new_edges_to_heap): Assert edge_callee is not
NULL.
(speculation_useful_p): Early return true if edge is inlined, remove
later checks for inline_failed.

testsuite/
* g++.dg/lto/pr89330_[01].C: New test.
* g++.dg/tree-prof/devirt.C: Added -fno-profile-values to dg-options.

From-SVN: r273825
gcc/ChangeLog
gcc/ipa-inline-transform.c
gcc/ipa-inline.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/lto/pr89330_0.C [new file with mode: 0644]
gcc/testsuite/g++.dg/lto/pr89330_1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/tree-prof/devirt.C