aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2014-10-27 18:40:37 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2014-10-27 18:40:37 +0000
commit9dc7a9da32c24233f30b6cc76381933298c2eaa9 (patch)
tree0222e6e8180e4f43cc50b06425071998be61e182 /gcc
parent3dfc96ea690917c6d15775c1189140922dd35bca (diff)
downloadgcc-9dc7a9da32c24233f30b6cc76381933298c2eaa9.zip
gcc-9dc7a9da32c24233f30b6cc76381933298c2eaa9.tar.gz
gcc-9dc7a9da32c24233f30b6cc76381933298c2eaa9.tar.bz2
s390.c: Include rtl-iter.h.
gcc/ * config/s390/s390.c: Include rtl-iter.h. (check_dpu): Delete. (s390_loop_unroll_adjust): Only iterate over patterns. Use FOR_EACH_SUBRTX. From-SVN: r216753
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/s390/s390.c25
2 files changed, 14 insertions, 18 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b5dc7f2..534542c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2014-10-27 Richard Sandiford <richard.sandiford@arm.com>
+ * config/s390/s390.c: Include rtl-iter.h.
+ (check_dpu): Delete.
+ (s390_loop_unroll_adjust): Only iterate over patterns.
+ Use FOR_EACH_SUBRTX.
+
+2014-10-27 Richard Sandiford <richard.sandiford@arm.com>
+
* config/spu/spu.c: Include rtl-iter.h
(ea_symbol_ref): Replace with...
(ea_symbol_ref_p): ...this new function.
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 1b10805..e8d7395 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -81,6 +81,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-pass.h"
#include "context.h"
#include "builtins.h"
+#include "rtl-iter.h"
/* Define the specific costs for a given cpu. */
@@ -11756,19 +11757,6 @@ s390_sched_init (FILE *file ATTRIBUTE_UNUSED,
s390_sched_state = 0;
}
-/* This function checks the whole of insn X for memory references. The
- function always returns zero because the framework it is called
- from would stop recursively analyzing the insn upon a return value
- other than zero. The real result of this function is updating
- counter variable MEM_COUNT. */
-static int
-check_dpu (rtx *x, unsigned *mem_count)
-{
- if (*x != NULL_RTX && MEM_P (*x))
- (*mem_count)++;
- return 0;
-}
-
/* This target hook implementation for TARGET_LOOP_UNROLL_ADJUST calculates
a new number struct loop *loop should be unrolled if tuned for cpus with
a built-in stride prefetcher.
@@ -11791,12 +11779,13 @@ s390_loop_unroll_adjust (unsigned nunroll, struct loop *loop)
/* Count the number of memory references within the loop body. */
bbs = get_loop_body (loop);
+ subrtx_iterator::array_type array;
for (i = 0; i < loop->num_nodes; i++)
- {
- for (insn = BB_HEAD (bbs[i]); insn != BB_END (bbs[i]); insn = NEXT_INSN (insn))
- if (INSN_P (insn) && INSN_CODE (insn) != -1)
- for_each_rtx_in_insn (&insn, (rtx_function) check_dpu, &mem_count);
- }
+ FOR_BB_INSNS (bbs[i], insn)
+ if (INSN_P (insn) && INSN_CODE (insn) != -1)
+ FOR_EACH_SUBRTX (iter, array, PATTERN (insn), NONCONST)
+ if (MEM_P (*iter))
+ mem_count += 1;
free (bbs);
/* Prevent division by zero, and we do not need to adjust nunroll in this case. */