summaryrefslogtreecommitdiff
path: root/gcc/alias.c
diff options
context:
space:
mode:
authorrevitale <revitale@138bc75d-0d04-0410-961f-82ee72b054a4>2009-01-21 11:39:19 +0000
committerrevitale <revitale@138bc75d-0d04-0410-961f-82ee72b054a4>2009-01-21 11:39:19 +0000
commit6e93a4c8a63318c29b830420bfeb61c65a9c5904 (patch)
tree9f0d4349fb3beba6fbbe170f65b83dc48644a965 /gcc/alias.c
parentcecf2961e4f4ad94fe71ed87ff1a4839a026b586 (diff)
downloadgcc-6e93a4c8a63318c29b830420bfeb61c65a9c5904.tar.gz
check alias sets in add_inter_loop_mem_dep
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@143540 138bc75d-0d04-0410-961f-82ee72b054a4
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 e5133d6a8c0..18c7d87a52f 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