From: Richard Sandiford Date: Thu, 28 Aug 2014 06:22:51 +0000 (+0000) Subject: ddg.c (walk_mems_2, [...]): Delete. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a3aa081329eaf8d7d87b02c3f3cd3c7e4f5678a9;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 89efc15e6b8..5ca9fb685b9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-08-28 Richard Sandiford + + * 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. + 2014-08-28 Richard Sandiford * ddg.c: Include rtl-iter.h. 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