Commit abebffc6 by Jan Hubicka Committed by Jan Hubicka

ipa-reference.c (ipa_reference_optimization_summary_d): Rename statics_not_read…

ipa-reference.c (ipa_reference_optimization_summary_d): Rename statics_not_read and statics_not_written to statics_read and...


	* ipa-reference.c (ipa_reference_optimization_summary_d): Rename
	statics_not_read and statics_not_written to statics_read and
	statics_written respectively.
	(no_module_statics): New static var.
	(ipa_reference_get_not_read_global): Rename to ...
	(ipa_reference_get_read_global): ... this.
	(ipa_reference_get_not_written_global): Rename to ...
	(ipa_reference_get_written_global): ... this.
	(dump_static_vars_set_to_file): Dump no_module_statics.
	(copy_static_var_set): Add for propagation parameter.
	(ipa_init): Initialize no_module_statics.
	(ipa_ref_opt_summary_t::duplicate): Update.
	(ipa_ref_opt_summary_t::remove): Update.
	(propagate): Update.
	(write_node_summary_p): Look correctly for bitmap differences.
	(ipa_reference_write_optimization_summary): Update.
	(ipa_reference_read_optimization_summary): Update.
	* ipa-reference.h
	(ipa_reference_get_not_read_global): Rename to ...
	(ipa_reference_get_read_global): ... this.
	(ipa_reference_get_not_written_global): Rename to ...
	(ipa_reference_get_written_global): ... this.
	* tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Update.
	(call_may_clobber_ref_p_1): Update.

From-SVN: r277403
parent 39a6e72a
2019-10-24 Jan Hubicka <hubicka@ucw.cz>
* ipa-reference.c (ipa_reference_optimization_summary_d): Rename
statics_not_read and statics_not_written to statics_read and
statics_written respectively.
(no_module_statics): New static var.
(ipa_reference_get_not_read_global): Rename to ...
(ipa_reference_get_read_global): ... this.
(ipa_reference_get_not_written_global): Rename to ...
(ipa_reference_get_written_global): ... this.
(dump_static_vars_set_to_file): Dump no_module_statics.
(copy_static_var_set): Add for propagation parameter.
(ipa_init): Initialize no_module_statics.
(ipa_ref_opt_summary_t::duplicate): Update.
(ipa_ref_opt_summary_t::remove): Update.
(propagate): Update.
(write_node_summary_p): Look correctly for bitmap differences.
(ipa_reference_write_optimization_summary): Update.
(ipa_reference_read_optimization_summary): Update.
* ipa-reference.h
(ipa_reference_get_not_read_global): Rename to ...
(ipa_reference_get_read_global): ... this.
(ipa_reference_get_not_written_global): Rename to ...
(ipa_reference_get_written_global): ... this.
* tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Update.
(call_may_clobber_ref_p_1): Update.
2019-10-24 Jozef Lawrynowicz <jozef.l@mittosystems.com> 2019-10-24 Jozef Lawrynowicz <jozef.l@mittosystems.com>
* config/msp430/msp430.c (msp430_hard_regno_nregs_has_padding): Remove * config/msp430/msp430.c (msp430_hard_regno_nregs_has_padding): Remove
...@@ -22,8 +22,8 @@ along with GCC; see the file COPYING3. If not see ...@@ -22,8 +22,8 @@ along with GCC; see the file COPYING3. If not see
#define GCC_IPA_REFERENCE_H #define GCC_IPA_REFERENCE_H
/* In ipa-reference.c */ /* In ipa-reference.c */
bitmap ipa_reference_get_not_read_global (struct cgraph_node *fn); bitmap ipa_reference_get_read_global (struct cgraph_node *fn);
bitmap ipa_reference_get_not_written_global (struct cgraph_node *fn); bitmap ipa_reference_get_written_global (struct cgraph_node *fn);
void ipa_reference_c_finalize (void); void ipa_reference_c_finalize (void);
int ipa_reference_var_uid (tree t); int ipa_reference_var_uid (tree t);
......
...@@ -2529,14 +2529,16 @@ ref_maybe_used_by_call_p_1 (gcall *call, ao_ref *ref, bool tbaa_p) ...@@ -2529,14 +2529,16 @@ ref_maybe_used_by_call_p_1 (gcall *call, ao_ref *ref, bool tbaa_p)
if (callee != NULL_TREE && VAR_P (base) && TREE_STATIC (base)) if (callee != NULL_TREE && VAR_P (base) && TREE_STATIC (base))
{ {
struct cgraph_node *node = cgraph_node::get (callee); struct cgraph_node *node = cgraph_node::get (callee);
bitmap not_read; bitmap read;
int id;
/* FIXME: Callee can be an OMP builtin that does not have a call graph /* FIXME: Callee can be an OMP builtin that does not have a call graph
node yet. We should enforce that there are nodes for all decls in the node yet. We should enforce that there are nodes for all decls in the
IL and remove this check instead. */ IL and remove this check instead. */
if (node if (node
&& (not_read = ipa_reference_get_not_read_global (node)) && (id = ipa_reference_var_uid (base)) != -1
&& bitmap_bit_p (not_read, ipa_reference_var_uid (base))) && (read = ipa_reference_get_read_global (node))
&& !bitmap_bit_p (read, id))
goto process_args; goto process_args;
} }
...@@ -2924,11 +2926,13 @@ call_may_clobber_ref_p_1 (gcall *call, ao_ref *ref) ...@@ -2924,11 +2926,13 @@ call_may_clobber_ref_p_1 (gcall *call, ao_ref *ref)
if (callee != NULL_TREE && VAR_P (base) && TREE_STATIC (base)) if (callee != NULL_TREE && VAR_P (base) && TREE_STATIC (base))
{ {
struct cgraph_node *node = cgraph_node::get (callee); struct cgraph_node *node = cgraph_node::get (callee);
bitmap not_written; bitmap written;
int id;
if (node if (node
&& (not_written = ipa_reference_get_not_written_global (node)) && (id = ipa_reference_var_uid (base)) != -1
&& bitmap_bit_p (not_written, ipa_reference_var_uid (base))) && (written = ipa_reference_get_written_global (node))
&& !bitmap_bit_p (written, id))
return false; return false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment