Commit 90631280 by Paolo Bonzini Committed by Paolo Bonzini

gcse.c (hash_scan_set): Look through REG_EQUAL or REG_EQUIV notes also when doing PRE...

2005-11-24  Paolo Bonzini  <bonzini@gnu.org>

	* gcse.c (hash_scan_set): Look through REG_EQUAL or REG_EQUIV notes
	also when doing PRE, rather than only for global CPROP.

From-SVN: r107456
parent 9df540a8
2005-11-24 Paolo Bonzini <bonzini@gnu.org>
* gcse.c (hash_scan_set): Look through REG_EQUAL or REG_EQUIV notes
also when doing PRE, rather than only for global CPROP.
2005-11-24 Ben Elliston <bje@au.ibm.com> 2005-11-24 Ben Elliston <bje@au.ibm.com>
* machmode.h (CLASS_HAS_WIDER_MODES_P): New macro. * machmode.h (CLASS_HAS_WIDER_MODES_P): New macro.
......
...@@ -1700,10 +1700,15 @@ hash_scan_set (rtx pat, rtx insn, struct hash_table *table) ...@@ -1700,10 +1700,15 @@ hash_scan_set (rtx pat, rtx insn, struct hash_table *table)
unsigned int regno = REGNO (dest); unsigned int regno = REGNO (dest);
rtx tmp; rtx tmp;
/* If this is a single set and we are doing constant propagation, /* See if a REG_NOTE shows this equivalent to a simpler expression.
see if a REG_NOTE shows this equivalent to a constant. */ This allows us to do a single GCSE pass and still eliminate
if (table->set_p && (note = find_reg_equal_equiv_note (insn)) != 0 redundant constants, addresses or other expressions that are
&& gcse_constant_p (XEXP (note, 0))) constructed with multiple instructions. */
note = find_reg_equal_equiv_note (insn);
if (note != 0
&& (table->set_p
? gcse_constant_p (XEXP (note, 0))
: want_to_gcse_p (XEXP (note, 0))))
src = XEXP (note, 0), pat = gen_rtx_SET (VOIDmode, dest, src); src = XEXP (note, 0), pat = gen_rtx_SET (VOIDmode, dest, src);
/* Only record sets of pseudo-regs in the hash table. */ /* Only record sets of pseudo-regs in the hash table. */
...@@ -1724,8 +1729,7 @@ hash_scan_set (rtx pat, rtx insn, struct hash_table *table) ...@@ -1724,8 +1729,7 @@ hash_scan_set (rtx pat, rtx insn, struct hash_table *table)
REG_EQUIV notes and if the argument slot is used somewhere REG_EQUIV notes and if the argument slot is used somewhere
explicitly, it means address of parameter has been taken, explicitly, it means address of parameter has been taken,
so we should not extend the lifetime of the pseudo. */ so we should not extend the lifetime of the pseudo. */
&& ((note = find_reg_note (insn, REG_EQUIV, NULL_RTX)) == 0 && (note == NULL_RTX || ! MEM_P (XEXP (note, 0))))
|| ! MEM_P (XEXP (note, 0))))
{ {
/* An expression is not anticipatable if its operands are /* An expression is not anticipatable if its operands are
modified before this insn or if this is not the only SET in modified before this insn or if this is not the only SET in
......
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