• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GCC with patches for OS216


Commit MetaInfo

Revision3fd18ee6041651747fc70aba4d7afd3fc8c48bc4 (tree)
Time2020-06-24 08:48:01
AuthorGiuliano Belinassi <giuliano.belinassi@usp....>
CommiterGiuliano Belinassi

Log Message

Run ipa passes when split_outputs

Previously, a bug prevented the ipa passes to run when split_outputs
is provided. This commit fixes that by correctly setting the guard,
and updates how the flags in the partition boundary accordingly.

gcc/ChangeLog
2020-06-23 Giuliano Belinassi <giuliano.belinassi@usp.br>

* cgraphunit.c (ipa_passes): Run ipa passes also when
split_outputs.
* ipa-icf.c (gate): Don't run when split_outputs.
* lto-cgraph.c (lto_apply_partition_mask): Correctly set nodes in
the partition boundary.

Change Summary

Incremental Difference

--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
1+2020-06-23 Giuliano Belinassi <giuliano.belinassi@usp.br>
2+
3+ * cgraphunit.c (ipa_passes): Run ipa passes also when
4+ split_outputs.
5+ * ipa-icf.c (gate): Don't run when split_outputs.
6+ * lto-cgraph.c (lto_apply_partition_mask): Correctly set nodes in
7+ the partition boundary.
8+
19 2020-06-18 Giuliano Belinassi <giuliano.belinassi@usp.br>
210
311 * toplev.c (lang_dependent_init): Move call to init_asm output to
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -2769,7 +2769,7 @@ ipa_passes (void)
27692769 if (flag_generate_lto || flag_generate_offload)
27702770 targetm.asm_out.lto_end ();
27712771
2772- if (!flag_ltrans
2772+ if ((!flag_ltrans || split_outputs)
27732773 && ((in_lto_p && flag_incremental_link != INCREMENTAL_LINK_LTO)
27742774 || !flag_lto || flag_fat_lto_objects))
27752775 execute_ipa_pass_list (passes->all_regular_ipa_passes);
--- a/gcc/ipa-icf.c
+++ b/gcc/ipa-icf.c
@@ -2345,7 +2345,7 @@ sem_item_optimizer::filter_removed_items (void)
23452345 {
23462346 cgraph_node *cnode = static_cast <sem_function *>(item)->get_node ();
23472347
2348- if (in_lto_p && (cnode->alias || cnode->body_removed))
2348+ if ((in_lto_p || split_outputs) && (cnode->alias || cnode->body_removed))
23492349 remove_item (item);
23502350 else
23512351 filtered.safe_push (item);
--- a/gcc/ipa-visibility.c
+++ b/gcc/ipa-visibility.c
@@ -963,7 +963,7 @@ public:
963963 virtual bool gate (function *)
964964 {
965965 /* Only run on ltrans strage if split-args was provided. */
966- bool ret = !flag_ltrans || split_outputs;
966+ bool ret = !flag_ltrans;
967967 return ret;
968968 }
969969 virtual unsigned int execute (function *)
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -2106,10 +2106,32 @@ lto_apply_partition_mask (ltrans_partition partition)
21062106 cgraph_node *cnode = dyn_cast <cgraph_node *> (node);
21072107 if (cnode)
21082108 {
2109- maybe_release_function_dominators (cnode);
2110- cnode->release_body ();
2111- if (!cnode->definition)
2112- cnode->body_removed = true;
2109+ if (cnode->clone_of)
2110+ cnode->remove_from_clone_tree ();
2111+
2112+ if (cnode->has_gimple_body_p ())
2113+ {
2114+ maybe_release_function_dominators (cnode);
2115+ cnode->remove_callees ();
2116+ cnode->remove_all_references ();
2117+ cnode->release_body ();
2118+ cnode->body_removed = true;
2119+ cnode->analyzed = false;
2120+ cnode->definition = false;
2121+ cnode->cpp_implicit_alias = false;
2122+ cnode->alias = false;
2123+ cnode->transparent_alias = false;
2124+ cnode->thunk.thunk_p = false;
2125+ cnode->weakref = false;
2126+ /* After early inlining we drop always_inline attributes on
2127+ bodies of functions that are still referenced (have their
2128+ address taken). */
2129+ DECL_ATTRIBUTES (cnode->decl)
2130+ = remove_attribute ("always_inline",
2131+ DECL_ATTRIBUTES (node->decl));
2132+
2133+ cnode->in_other_partition = true;
2134+ }
21132135 }
21142136 }
21152137 }
@@ -2127,4 +2149,6 @@ lto_apply_partition_mask (ltrans_partition partition)
21272149
21282150 node->remove ();
21292151 }
2152+
2153+ symtab->remove_unreachable_nodes (NULL);
21302154 }