+2019-05-20 Jan Hubicka <hubicka@ucw.cz>
+
+ * tree-ssa-alias.c (refs_may_alias_p_2): Break out from ...
+ (refs_may_alias_p_1): ... here; update stats.
+ (refs_may_alias_p): Do not update stats here.
+
2019-05-20 Richard Biener <rguenther@suse.de>
* tree-ssa-structalias.c (find_func_aliases): POINTER_DIFF_EXPR
/* Return true, if the two memory references REF1 and REF2 may alias. */
-bool
-refs_may_alias_p_1 (ao_ref *ref1, ao_ref *ref2, bool tbaa_p)
+static bool
+refs_may_alias_p_2 (ao_ref *ref1, ao_ref *ref2, bool tbaa_p)
{
tree base1, base2;
poly_int64 offset1 = 0, offset2 = 0;
gcc_unreachable ();
}
+/* Return true, if the two memory references REF1 and REF2 may alias
+ and update statistics. */
+
+bool
+refs_may_alias_p_1 (ao_ref *ref1, ao_ref *ref2, bool tbaa_p)
+{
+ bool res = refs_may_alias_p_2 (ref1, ref2, tbaa_p);
+ if (res)
+ ++alias_stats.refs_may_alias_p_may_alias;
+ else
+ ++alias_stats.refs_may_alias_p_no_alias;
+ return res;
+}
+
static bool
refs_may_alias_p (tree ref1, ao_ref *ref2, bool tbaa_p)
{
refs_may_alias_p (tree ref1, tree ref2, bool tbaa_p)
{
ao_ref r1, r2;
- bool res;
ao_ref_init (&r1, ref1);
ao_ref_init (&r2, ref2);
- res = refs_may_alias_p_1 (&r1, &r2, tbaa_p);
- if (res)
- ++alias_stats.refs_may_alias_p_may_alias;
- else
- ++alias_stats.refs_may_alias_p_no_alias;
- return res;
+ return refs_may_alias_p_1 (&r1, &r2, tbaa_p);
}
/* Returns true if there is a anti-dependence for the STORE that