diff options
author | Jim Wilson <wilson@cygnus.com> | 1998-05-11 18:11:22 +0000 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1998-05-11 11:11:22 -0700 |
commit | b1a7d591044bbb15da6e4bc0af3411dd50ecc603 (patch) | |
tree | dd3fdadca628c1bf3fe5e14f12741cfc87ad4b06 | |
parent | 50324922d7dd933b53c6a18a0d83b997af215571 (diff) | |
download | gcc-b1a7d591044bbb15da6e4bc0af3411dd50ecc603.zip gcc-b1a7d591044bbb15da6e4bc0af3411dd50ecc603.tar.gz gcc-b1a7d591044bbb15da6e4bc0af3411dd50ecc603.tar.bz2 |
Add missing comments pointed out by Andreas Schwab.
* regmove.c (fixup_match_2, find_matches, regmove_profitable):
Add explanatory comments.
From-SVN: r19677
-rw-r--r-- | gcc/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/regmove.c | 26 |
2 files changed, 28 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dd7c9f6..5f68e1b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ Mon May 11 17:43:03 1998 Jim Wilson <wilson@cygnus.com> + * regmove.c (fixup_match_2, find_matches, regmove_profitable): + Add explanatory comments. + * sparc.h (SPARC_INCOMING_INT_ARG_FIRST): Support TARGET_FLAT. Mon May 11 17:24:27 1998 Richard Henderson <rth@cygnus.com> diff --git a/gcc/regmove.c b/gcc/regmove.c index 81a9870..75798b0 100644 --- a/gcc/regmove.c +++ b/gcc/regmove.c @@ -570,8 +570,24 @@ reg_is_remote_constant_p (reg, insn, first) return 0; } +/* INSN is adding a CONST_INT to a REG. We search backwards looking for + another add immediate instruction with the same source and dest registers, + and if we find one, we change INSN to an increment, and return 1. If + no changes are made, we return 0. + + This changes + (set (reg100) (plus reg1 offset1)) + ... + (set (reg100) (plus reg1 offset2)) + to + (set (reg100) (plus reg1 offset1)) + ... + (set (reg100) (plus reg100 offset2-offset1)) */ + +/* ??? What does this comment mean? */ /* cse disrupts preincrement / postdecrement squences when it finds a hard register as ultimate source, like the frame pointer. */ + int fixup_match_2 (insn, dst, src, offset, regmove_dump_file) rtx insn, dst, src, offset; @@ -1143,6 +1159,11 @@ regmove_optimize (f, nregs, regmove_dump_file) #endif /* REGISTER_CONSTRAINTS */ } +/* Returns the INSN_CODE for INSN if its pattern has matching constraints for + any operand. Returns -1 if INSN can't be recognized, or if the alternative + can't be determined. + + Initialize the info in MATCHP based on the constraints. */ static int find_matches (insn, matchp) @@ -1711,7 +1732,10 @@ stable_but_for_p (x, src, dst) } } -/* Test if regmove seems profitable for this target. */ +/* Test if regmove seems profitable for this target. Regmove is useful only + if some common patterns are two address, i.e. require matching constraints, + so we check that condition here. */ + int regmove_profitable_p () { |