Commit 430d1e8d by Martin Liska Committed by Martin Liska

Remove comparison for polymorphic types.

2019-10-30  Martin Liska  <mliska@suse.cz>

	* ipa-icf-gimple.c (func_checker::func_checker): Do not
	initialize m_compare_polymorphic.
	(func_checker::compare_decl): Do not compare polymorphic types.
	* ipa-icf-gimple.h (m_compare_polymorphic): Remove.
	* ipa-icf.c (sem_function::equals_private): Do not call
	compare_polymorphic_p.

From-SVN: r277617
parent 938bba61
2019-10-30 Martin Liska <mliska@suse.cz> 2019-10-30 Martin Liska <mliska@suse.cz>
* ipa-icf-gimple.c (func_checker::func_checker): Do not
initialize m_compare_polymorphic.
(func_checker::compare_decl): Do not compare polymorphic types.
* ipa-icf-gimple.h (m_compare_polymorphic): Remove.
* ipa-icf.c (sem_function::equals_private): Do not call
compare_polymorphic_p.
2019-10-30 Martin Liska <mliska@suse.cz>
* ipa-icf-gimple.c (func_checker::compare_ssa_name): Call * ipa-icf-gimple.c (func_checker::compare_ssa_name): Call
compare_operand. compare_operand.
(func_checker::compare_memory_operand): Remove. (func_checker::compare_memory_operand): Remove.
...@@ -51,14 +51,12 @@ namespace ipa_icf_gimple { ...@@ -51,14 +51,12 @@ namespace ipa_icf_gimple {
of declarations that can be skipped. */ of declarations that can be skipped. */
func_checker::func_checker (tree source_func_decl, tree target_func_decl, func_checker::func_checker (tree source_func_decl, tree target_func_decl,
bool compare_polymorphic,
bool ignore_labels, bool ignore_labels,
hash_set<symtab_node *> *ignored_source_nodes, hash_set<symtab_node *> *ignored_source_nodes,
hash_set<symtab_node *> *ignored_target_nodes) hash_set<symtab_node *> *ignored_target_nodes)
: m_source_func_decl (source_func_decl), m_target_func_decl (target_func_decl), : m_source_func_decl (source_func_decl), m_target_func_decl (target_func_decl),
m_ignored_source_nodes (ignored_source_nodes), m_ignored_source_nodes (ignored_source_nodes),
m_ignored_target_nodes (ignored_target_nodes), m_ignored_target_nodes (ignored_target_nodes),
m_compare_polymorphic (compare_polymorphic),
m_ignore_labels (ignore_labels) m_ignore_labels (ignore_labels)
{ {
function *source_func = DECL_STRUCT_FUNCTION (source_func_decl); function *source_func = DECL_STRUCT_FUNCTION (source_func_decl);
...@@ -156,23 +154,7 @@ func_checker::compare_decl (tree t1, tree t2) ...@@ -156,23 +154,7 @@ func_checker::compare_decl (tree t1, tree t2)
if (!compatible_types_p (TREE_TYPE (t1), TREE_TYPE (t2))) if (!compatible_types_p (TREE_TYPE (t1), TREE_TYPE (t2)))
return return_false (); return return_false ();
/* TODO: we are actually too strict here. We only need to compare if
T1 can be used in polymorphic call. */
if (TREE_ADDRESSABLE (t1)
&& m_compare_polymorphic
&& !compatible_polymorphic_types_p (TREE_TYPE (t1), TREE_TYPE (t2),
false))
return return_false ();
if ((t == VAR_DECL || t == PARM_DECL || t == RESULT_DECL)
&& DECL_BY_REFERENCE (t1)
&& m_compare_polymorphic
&& !compatible_polymorphic_types_p (TREE_TYPE (t1), TREE_TYPE (t2),
true))
return return_false ();
bool existed_p; bool existed_p;
tree &slot = m_decl_map.get_or_insert (t1, &existed_p); tree &slot = m_decl_map.get_or_insert (t1, &existed_p);
if (existed_p) if (existed_p)
return return_with_debug (slot == t2); return return_with_debug (slot == t2);
......
...@@ -128,7 +128,6 @@ public: ...@@ -128,7 +128,6 @@ public:
Similarly, IGNORE_SOURCE_DECLS and IGNORE_TARGET_DECLS are sets Similarly, IGNORE_SOURCE_DECLS and IGNORE_TARGET_DECLS are sets
of declarations that can be skipped. */ of declarations that can be skipped. */
func_checker (tree source_func_decl, tree target_func_decl, func_checker (tree source_func_decl, tree target_func_decl,
bool compare_polymorphic,
bool ignore_labels = false, bool ignore_labels = false,
hash_set<symtab_node *> *ignored_source_nodes = NULL, hash_set<symtab_node *> *ignored_source_nodes = NULL,
hash_set<symtab_node *> *ignored_target_nodes = NULL); hash_set<symtab_node *> *ignored_target_nodes = NULL);
...@@ -258,9 +257,6 @@ private: ...@@ -258,9 +257,6 @@ private:
/* Label to basic block index mapping. */ /* Label to basic block index mapping. */
hash_map <tree, int> m_label_bb_map; hash_map <tree, int> m_label_bb_map;
/* Flag if polymorphic comparison should be executed. */
bool m_compare_polymorphic;
/* Flag if ignore labels in comparison. */ /* Flag if ignore labels in comparison. */
bool m_ignore_labels; bool m_ignore_labels;
......
...@@ -845,7 +845,6 @@ sem_function::equals_private (sem_item *item) ...@@ -845,7 +845,6 @@ sem_function::equals_private (sem_item *item)
return return_false (); return return_false ();
m_checker = new func_checker (decl, m_compared_func->decl, m_checker = new func_checker (decl, m_compared_func->decl,
compare_polymorphic_p (),
false, false,
&refs_set, &refs_set,
&m_compared_func->refs_set); &m_compared_func->refs_set);
......
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