Hi all,

We recently (well, within the last year or two) introduced a general function 
to detect MEM sub-rtxes in rtlanal.c: contains_mem_rtx_p.
We can use that in aarch64.c and remove the custom has_memory_op that is 
defined in the same way (except that it takes an rtx_insn * instead of an rtx).

Bootstrapped and tested on aarch64-none-linux-gnu.
Committing as obvious.

Thanks,
Kyrill

2016-02-13  Kyrylo Tkachov  <kyrylo.tkac...@arm.com>

    * config/aarch64/aarch64.c (has_memory_op): Delete.
    (aarch64_madd_needs_nop): Use contains_mem_rtx_p instead of
    has_memory_op.
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index f72e4c4423d28af66f3bd8068eeb83060d541839..e0289dd3559f07572d581d533212105c4ca90619 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -10965,21 +10965,6 @@ aarch64_mangle_type (const_tree type)
   return NULL;
 }
 
-
-/* Return true if the rtx_insn contains a MEM RTX somewhere
-   in it.  */
-
-static bool
-has_memory_op (rtx_insn *mem_insn)
-{
-  subrtx_iterator::array_type array;
-  FOR_EACH_SUBRTX (iter, array, PATTERN (mem_insn), ALL)
-    if (MEM_P (*iter))
-      return true;
-
-  return false;
-}
-
 /* Find the first rtx_insn before insn that will generate an assembly
    instruction.  */
 
@@ -11072,7 +11057,7 @@ aarch64_madd_needs_nop (rtx_insn* insn)
      Restore recog state to INSN to avoid state corruption.  */
   extract_constrain_insn_cached (insn);
 
-  if (!prev || !has_memory_op (prev))
+  if (!prev || !contains_mem_rtx_p (PATTERN (prev)))
     return false;
 
   body = single_set (prev);

Reply via email to