aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-alias.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2019-05-20 15:37:11 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2019-05-20 13:37:11 +0000
commiteb061601564dfe61d8a2fe8519a7b6057af2b17d (patch)
treecad9d9f379e6896c76e6fc9000a46242732ce0b1 /gcc/tree-ssa-alias.c
parent0841bc15630c18bac94ff6ed8ba2d878d639caf6 (diff)
downloadgcc-eb061601564dfe61d8a2fe8519a7b6057af2b17d.zip
gcc-eb061601564dfe61d8a2fe8519a7b6057af2b17d.tar.gz
gcc-eb061601564dfe61d8a2fe8519a7b6057af2b17d.tar.bz2
tree-ssa-alias.c (refs_may_alias_p_2): Break out from ...
* 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. From-SVN: r271419
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r--gcc/tree-ssa-alias.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index 0fa413a..5b5f146 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -1470,8 +1470,8 @@ indirect_refs_may_alias_p (tree ref1 ATTRIBUTE_UNUSED, tree base1,
/* 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;
@@ -1628,6 +1628,20 @@ refs_may_alias_p_1 (ao_ref *ref1, ao_ref *ref2, bool tbaa_p)
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)
{
@@ -1640,15 +1654,9 @@ bool
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