[PR81611] turn inc-and-use-of-dead-orig into auto-inc

Programming / Compilers / GCC - aoliva [138bc75d-0d04-0410-961f-82ee72b054a4] - 28 February 2018 05:25 EST

When the addressing modes available on the machine don't allow offsets in addresses, odds are that post-increments will be represented in trees and RTL as:

y <= x + 1 ... *(x) ... x <= y

so deal with it by turning such RTL as:

(set y (plus x n)) ... (mem x) ...

without intervening uses of y into

(set y x) ... (mem (post_add y n)) ...

so as to create auto-inc addresses that we'd otherwise miss.

for gcc/ChangeLog

PR rtl-optimization/81611
- auto-inc-dec.c (attempt_change): Move dead note from mem_insn if it's the next use of regno (find_address): Take address use of reg holding non-incremented value. Add parm to limit search to the named reg only. (merge_in_block): Attempt to use a mem insn that is the next use of the original regno.

d4ce94c11ee [PR81611] turn inc-and-use-of-dead-orig into auto-inc
gcc/ChangeLog | 11 +++++
gcc/auto-inc-dec.c | 140 +++++++++++++++++++++++++++++++++++++++++++++++++----
2 files changed, 141 insertions(+), 10 deletions(-)

Upstream: gcc.gnu.org

  • Share