+2019-11-14 Martin Liska <mliska@suse.cz>
+
+ * ipa-icf.c (sem_item_optimizer::execute): Save
+ loaded_symbols.
+ (sem_item_optimizer::parse_nonsingleton_classes):
+ Return number of loaded symbols.
+ (sem_item_optimizer::merge_classes): Print
+ statistics about totally needed symbols.
+ * ipa-icf.h (parse_nonsingleton_classes): Change return
+ type.
+ (merge_classes): Add one argument.
+
2019-11-14 Martin Liska <mliska@suse.cz>
* ipa-icf-gimple.c (func_checker::hash_operand): Improve
dump_cong_classes ();
- parse_nonsingleton_classes ();
+ unsigned int loaded_symbols = parse_nonsingleton_classes ();
subdivide_classes_by_equality ();
if (dump_file)
process_cong_reduction ();
dump_cong_classes ();
checking_verify_classes ();
- bool merged_p = merge_classes (prev_class_count);
+ bool merged_p = merge_classes (prev_class_count, loaded_symbols);
if (dump_file && (dump_flags & TDF_DETAILS))
symtab->dump (dump_file);
/* Semantic items in classes having more than one element and initialized.
In case of WPA, we load function body. */
-void
+unsigned int
sem_item_optimizer::parse_nonsingleton_classes (void)
{
unsigned int counter = 0;
float f = m_items.length () ? 100.0f * counter / m_items.length () : 0.0f;
fprintf (dump_file, "Init called for %u items (%.2f%%).\n", counter, f);
}
+
+ return counter;
}
/* Equality function for semantic items is used to subdivide existing
/* 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. True is returned if there's a merge operation
- processed. */
+ processed. LOADED_SYMBOLS is number of symbols that were loaded
+ in WPA. */
bool
-sem_item_optimizer::merge_classes (unsigned int prev_class_count)
+sem_item_optimizer::merge_classes (unsigned int prev_class_count,
+ unsigned int loaded_symbols)
{
unsigned int item_count = m_items.length ();
unsigned int class_count = m_classes_count;
non_singular_classes_count : 0.0f,
non_singular_classes_count);
fprintf (dump_file, "Equal symbols: %u\n", equal_items);
- fprintf (dump_file, "Fraction of visited symbols: %.2f%%\n\n",
- item_count ? 100.0f * equal_items / item_count : 0.0f);
+ unsigned total = equal_items + non_singular_classes_count;
+ fprintf (dump_file, "Totally needed symbols: %u"
+ ", fraction of loaded symbols: %.2f%%\n\n", total,
+ loaded_symbols ? 100.0f * total / loaded_symbols: 0.0f);
}
unsigned int l;
/* Semantic items in classes having more than one element and initialized.
In case of WPA, we load function body. */
- void parse_nonsingleton_classes (void);
+ unsigned int parse_nonsingleton_classes (void);
/* Equality function for semantic items is used to subdivide existing
classes. If IN_WPA, fast equality function is invoked. */
/* 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. True is returned if there's a merge operation
- processed. */
- bool merge_classes (unsigned int prev_class_count);
+ processed. LOADED_SYMBOLS is number of symbols that were loaded
+ in WPA. */
+ bool merge_classes (unsigned int prev_class_count,
+ unsigned int loaded_symbols);
/* Fixup points to analysis info. */
void fixup_points_to_sets (void);