summaryrefslogtreecommitdiff
path: root/gcc/ddg.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2014-08-28 06:22:51 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2014-08-28 06:22:51 +0000
commita3aa081329eaf8d7d87b02c3f3cd3c7e4f5678a9 (patch)
tree5ef9b0eeee337f510c235d15107904628e7750ef /gcc/ddg.c
parentfbf3fc0fc96c5542f982b68873e2ff8330f8c0c6 (diff)
downloadgcc-a3aa081329eaf8d7d87b02c3f3cd3c7e4f5678a9.tar.gz
ddg.c (walk_mems_2, [...]): Delete.
gcc/ * ddg.c (walk_mems_2, walk_mems_1): Delete. (insns_may_alias_p): Use FOR_EACH_SUBRTX rather than for_each_rtx to iterate over subrtxes. Return a bool rather than an int. From-SVN: r214633
Diffstat (limited to 'gcc/ddg.c')
-rw-r--r--gcc/ddg.c48
1 files changed, 16 insertions, 32 deletions
diff --git a/gcc/ddg.c b/gcc/ddg.c
index 7514c11dc5d..09757185b2e 100644
--- a/gcc/ddg.c
+++ b/gcc/ddg.c
@@ -397,41 +397,25 @@ build_inter_loop_deps (ddg_ptr g)
}
-static int
-walk_mems_2 (rtx *x, rtx mem)
-{
- if (MEM_P (*x))
- {
- if (may_alias_p (*x, mem))
- return 1;
-
- return -1;
- }
- return 0;
-}
-
-static int
-walk_mems_1 (rtx *x, rtx *pat)
+/* Return true if two specified instructions have mem expr with conflict
+ alias sets. */
+static bool
+insns_may_alias_p (rtx_insn *insn1, rtx_insn *insn2)
{
- if (MEM_P (*x))
+ subrtx_iterator::array_type array1;
+ subrtx_iterator::array_type array2;
+ FOR_EACH_SUBRTX (iter1, array1, PATTERN (insn1), NONCONST)
{
- /* Visit all MEMs in *PAT and check independence. */
- if (for_each_rtx (pat, (rtx_function) walk_mems_2, *x))
- /* Indicate that dependence was determined and stop traversal. */
- return 1;
-
- return -1;
+ const_rtx x1 = *iter1;
+ if (MEM_P (x1))
+ FOR_EACH_SUBRTX (iter2, array2, PATTERN (insn2), NONCONST)
+ {
+ const_rtx x2 = *iter2;
+ if (MEM_P (x2) && may_alias_p (x2, x1))
+ return true;
+ }
}
- return 0;
-}
-
-/* Return 1 if two specified instructions have mem expr with conflict alias sets*/
-static int
-insns_may_alias_p (rtx_insn *insn1, rtx_insn *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 false;
}
/* Given two nodes, analyze their RTL insns and add intra-loop mem deps