+2015-03-03 Martin Liska <mliska@suse.cz>
+ Martin Jambor <mjambor@suse.cz>
+
+ PR ipa/65087
+ * ipa-icf.c (sem_item_optimizer::execute): Change function
+ return value to boolean.
+ (sem_item_optimizer::merge_classes): Likewise.
+ (ipa_icf_driver): Return TODO_remove_functions in case there's
+ a merge operation processed.
+ * ipa-icf.h: Change function return value to boolean.
+
2015-03-02 Michael Meissner <meissner@linux.vnet.ibm.com>
PR 65138/target
m_items.safe_push (filtered[i]);
}
-/* Optimizer entry point. */
+/* Optimizer entry point which returns true in case it processes
+ a merge operation. True is returned if there's a merge operation
+ processed. */
-void
+bool
sem_item_optimizer::execute (void)
{
filter_removed_items ();
process_cong_reduction ();
dump_cong_classes ();
verify_classes ();
- merge_classes (prev_class_count);
+ bool merged_p = merge_classes (prev_class_count);
if (dump_file && (dump_flags & TDF_DETAILS))
symtab_node::dump_table (dump_file);
+
+ return merged_p;
}
/* Function responsible for visiting all potential functions and
/* After reduction is done, we can declare all items in a group
to be equal. PREV_CLASS_COUNT is start number of classes
- before reduction. */
+ before reduction. True is returned if there's a merge operation
+ processed. */
-void
+bool
sem_item_optimizer::merge_classes (unsigned int prev_class_count)
{
unsigned int item_count = m_items.length ();
unsigned int non_singular_classes_count = 0;
unsigned int non_singular_classes_sum = 0;
+ bool merged_p = false;
+
for (hash_table<congruence_class_group_hash>::iterator it = m_classes.begin ();
it != m_classes.end (); ++it)
for (unsigned int i = 0; i < (*it)->classes.length (); i++)
alias->dump_to_file (dump_file);
}
- source->merge (alias);
+ if (source->merge (alias))
+ merged_p = true;
}
}
+
+ return merged_p;
}
/* Dump function prints all class members to a FILE with an INDENT. */
{
gcc_assert (optimizer);
- optimizer->execute ();
+ bool merged_p = optimizer->execute ();
delete optimizer;
optimizer = NULL;
- return 0;
+ return merged_p ? TODO_remove_functions : 0;
}
const pass_data pass_data_ipa_icf =
read-only variables that can be merged. */
void parse_funcs_and_vars (void);
- /* Optimizer entry point. */
- void execute (void);
+ /* Optimizer entry point which returns true in case it processes
+ a merge operation. True is returned if there's a merge operation
+ processed. */
+ bool execute (void);
/* Dump function. */
void dump (void);
/* After reduction is done, we can declare all items in a group
to be equal. PREV_CLASS_COUNT is start number of classes
- before reduction. */
- void merge_classes (unsigned int prev_class_count);
+ before reduction. True is returned if there's a merge operation
+ processed. */
+ bool merge_classes (unsigned int prev_class_count);
/* Adds a newly created congruence class CLS to worklist. */
void worklist_push (congruence_class *cls);