Commit 96b3c03f by Richard Biener Committed by Richard Biener

re PR rtl-optimization/61672 (Less redundant instructions deleted by pre_delete after r208113.)

2014-08-05  Richard Biener  <rguenther@suse.de>

	PR rtl-optimization/61672
	* emit-rtl.h (mem_attrs_eq_p): Declare.
	* emit-rtl.c (mem_attrs_eq_p): Export.  Handle NULL mem-attrs.
	* cse.c (exp_equiv_p): Use mem_attrs_eq_p.
	* cfgcleanup.c (merge_memattrs): Likewise.
	Include emit-rtl.h.

From-SVN: r213638
parent b8a5fbd2
2014-08-05 Richard Biener <rguenther@suse.de>
PR rtl-optimization/61672
* emit-rtl.h (mem_attrs_eq_p): Declare.
* emit-rtl.c (mem_attrs_eq_p): Export. Handle NULL mem-attrs.
* cse.c (exp_equiv_p): Use mem_attrs_eq_p.
* cfgcleanup.c (merge_memattrs): Likewise.
Include emit-rtl.h.
2014-08-05 Kyrylo Tkachov <kyrylo.tkachov@arm.com> 2014-08-05 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/aarch64/arm_neon.h (vqdmlals_lane_s32): Use scalar types * config/aarch64/arm_neon.h (vqdmlals_lane_s32): Use scalar types
......
...@@ -53,6 +53,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -53,6 +53,7 @@ along with GCC; see the file COPYING3. If not see
#include "df.h" #include "df.h"
#include "dce.h" #include "dce.h"
#include "dbgcnt.h" #include "dbgcnt.h"
#include "emit-rtl.h"
#define FORWARDER_BLOCK_P(BB) ((BB)->flags & BB_FORWARDER_BLOCK) #define FORWARDER_BLOCK_P(BB) ((BB)->flags & BB_FORWARDER_BLOCK)
...@@ -883,7 +884,7 @@ merge_memattrs (rtx x, rtx y) ...@@ -883,7 +884,7 @@ merge_memattrs (rtx x, rtx y)
if (GET_MODE (x) != GET_MODE (y)) if (GET_MODE (x) != GET_MODE (y))
return; return;
if (code == MEM && MEM_ATTRS (x) != MEM_ATTRS (y)) if (code == MEM && !mem_attrs_eq_p (MEM_ATTRS (x), MEM_ATTRS (y)))
{ {
if (! MEM_ATTRS (x)) if (! MEM_ATTRS (x))
MEM_ATTRS (y) = 0; MEM_ATTRS (y) = 0;
......
...@@ -2685,7 +2685,7 @@ exp_equiv_p (const_rtx x, const_rtx y, int validate, bool for_gcse) ...@@ -2685,7 +2685,7 @@ exp_equiv_p (const_rtx x, const_rtx y, int validate, bool for_gcse)
But because really all MEM attributes should be the same for But because really all MEM attributes should be the same for
equivalent MEMs, we just use the invariant that MEMs that have equivalent MEMs, we just use the invariant that MEMs that have
the same attributes share the same mem_attrs data structure. */ the same attributes share the same mem_attrs data structure. */
if (MEM_ATTRS (x) != MEM_ATTRS (y)) if (!mem_attrs_eq_p (MEM_ATTRS (x), MEM_ATTRS (y)))
return 0; return 0;
/* If we are handling exceptions, we cannot consider two expressions /* If we are handling exceptions, we cannot consider two expressions
......
...@@ -290,9 +290,13 @@ const_fixed_htab_eq (const void *x, const void *y) ...@@ -290,9 +290,13 @@ const_fixed_htab_eq (const void *x, const void *y)
/* Return true if the given memory attributes are equal. */ /* Return true if the given memory attributes are equal. */
static bool bool
mem_attrs_eq_p (const struct mem_attrs *p, const struct mem_attrs *q) mem_attrs_eq_p (const struct mem_attrs *p, const struct mem_attrs *q)
{ {
if (p == q)
return true;
if (!p || !q)
return false;
return (p->alias == q->alias return (p->alias == q->alias
&& p->offset_known_p == q->offset_known_p && p->offset_known_p == q->offset_known_p
&& (!p->offset_known_p || p->offset == q->offset) && (!p->offset_known_p || p->offset == q->offset)
......
...@@ -20,6 +20,9 @@ along with GCC; see the file COPYING3. If not see ...@@ -20,6 +20,9 @@ along with GCC; see the file COPYING3. If not see
#ifndef GCC_EMIT_RTL_H #ifndef GCC_EMIT_RTL_H
#define GCC_EMIT_RTL_H #define GCC_EMIT_RTL_H
/* Return whether two MEM_ATTRs are equal. */
bool mem_attrs_eq_p (const struct mem_attrs *, const struct mem_attrs *);
/* Set the alias set of MEM to SET. */ /* Set the alias set of MEM to SET. */
extern void set_mem_alias_set (rtx, alias_set_type); extern void set_mem_alias_set (rtx, alias_set_type);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment