[15/50] ddg.c:mark_mem_use
diff mbox

Message ID 8761i9bror.fsf@googlemail.com
State New
Headers show

Commit Message

Richard Sandiford Aug. 3, 2014, 1:58 p.m. UTC
gcc/
	* ddg.c: Include rtl-iter.h.
	(mark_mem_use_1): Rename to...
	(mark_mem_use): ...deleting old mark_mem_use.  Use FOR_EACH_SUBRTX
	instead of for_each_rtx.
	(mem_read_insn_p): Update accordingly.

Comments

Jeff Law Aug. 5, 2014, 9:04 p.m. UTC | #1
On 08/03/14 07:58, Richard Sandiford wrote:
> gcc/
> 	* ddg.c: Include rtl-iter.h.
> 	(mark_mem_use_1): Rename to...
> 	(mark_mem_use): ...deleting old mark_mem_use.  Use FOR_EACH_SUBRTX
> 	instead of for_each_rtx.
> 	(mem_read_insn_p): Update accordingly.
OK.
jeff

Patch
diff mbox

Index: gcc/ddg.c
===================================================================
--- gcc/ddg.c	2014-08-03 11:25:10.216957187 +0100
+++ gcc/ddg.c	2014-08-03 11:25:24.327096689 +0100
@@ -41,6 +41,7 @@  Software Foundation; either version 3, o
 #include "expr.h"
 #include "bitmap.h"
 #include "ddg.h"
+#include "rtl-iter.h"
 
 #ifdef INSN_SCHEDULING
 
@@ -63,19 +64,16 @@  static void add_edge_to_ddg (ddg_ptr g,
 static bool mem_ref_p;
 
 /* Auxiliary function for mem_read_insn_p.  */
-static int
-mark_mem_use (rtx *x, void *data ATTRIBUTE_UNUSED)
-{
-  if (MEM_P (*x))
-    mem_ref_p = true;
-  return 0;
-}
-
-/* Auxiliary function for mem_read_insn_p.  */
 static void
-mark_mem_use_1 (rtx *x, void *data)
+mark_mem_use (rtx *x, void *)
 {
-  for_each_rtx (x, mark_mem_use, data);
+  subrtx_iterator::array_type array;
+  FOR_EACH_SUBRTX (iter, array, *x, NONCONST)
+    if (MEM_P (*x))
+      {
+	mem_ref_p = true;
+	break;
+      }
 }
 
 /* Returns nonzero if INSN reads from memory.  */
@@ -83,7 +81,7 @@  mark_mem_use_1 (rtx *x, void *data)
 mem_read_insn_p (rtx insn)
 {
   mem_ref_p = false;
-  note_uses (&PATTERN (insn), mark_mem_use_1, NULL);
+  note_uses (&PATTERN (insn), mark_mem_use, NULL);
   return mem_ref_p;
 }