aboutsummaryrefslogtreecommitdiff
path: root/gcc/alias.c
diff options
context:
space:
mode:
authorBingfeng Mei <bmei@broadcom.com>2009-01-21 11:39:19 +0000
committerRevital Eres <revitale@gcc.gnu.org>2009-01-21 11:39:19 +0000
commit71a6fe66e7292912deda846c123134d2c43d43e1 (patch)
tree9f0d4349fb3beba6fbbe170f65b83dc48644a965 /gcc/alias.c
parent954a782e53528ecd7cf7dac4f68506ab74d629c2 (diff)
downloadgcc-71a6fe66e7292912deda846c123134d2c43d43e1.zip
gcc-71a6fe66e7292912deda846c123134d2c43d43e1.tar.gz
gcc-71a6fe66e7292912deda846c123134d2c43d43e1.tar.bz2
check alias sets in add_inter_loop_mem_dep
From-SVN: r143540
Diffstat (limited to 'gcc/alias.c')
-rw-r--r--gcc/alias.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/gcc/alias.c b/gcc/alias.c
index e5133d6..18c7d87 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -344,6 +344,43 @@ alias_sets_conflict_p (alias_set_type set1, alias_set_type set2)
return 0;
}
+static int
+walk_mems_2 (rtx *x, rtx mem)
+{
+ if (MEM_P (*x))
+ {
+ if (alias_sets_conflict_p (MEM_ALIAS_SET(*x), MEM_ALIAS_SET(mem)))
+ return 1;
+
+ return -1;
+ }
+ return 0;
+}
+
+static int
+walk_mems_1 (rtx *x, rtx *pat)
+{
+ if (MEM_P (*x))
+ {
+ /* Visit all MEMs in *PAT and check indepedence. */
+ if (for_each_rtx (pat, (rtx_function) walk_mems_2, *x))
+ /* Indicate that dependence was determined and stop traversal. */
+ return 1;
+
+ return -1;
+ }
+ return 0;
+}
+
+/* Return 1 if two specified instructions have mem expr with conflict alias sets*/
+bool
+insn_alias_sets_conflict_p (rtx insn1, rtx insn2)
+{
+ /* For each pair of MEMs in INSN1 and INSN2 check their independence. */
+ return for_each_rtx (&PATTERN (insn1), (rtx_function) walk_mems_1,
+ &PATTERN (insn2));
+}
+
/* Return 1 if the two specified alias sets will always conflict. */
int