Removing redundant slls from 64-bit MIPS code

Richard Sandiford rsandifo@redhat.com
Sat May 29 12:20:00 GMT 2004


Richard Henderson <rth@redhat.com> writes:
> On Fri, May 28, 2004 at 08:27:20AM +0100, Richard Sandiford wrote:
>> ! (define_insn_and_split "extendsidi2"
>>     [(set (match_operand:DI 0 "register_operand" "=d,d")
>> !         (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "0,m")))]
>
> Is there much difference if you do
>
> 	"=d,?d,?d"
> 	" 0, d, m

Doesn't look like it.  I just ran:

(define_insn_and_split "extendsidi2"
  [(set (match_operand:DI 0 "register_operand" "=d,?d,?d")
        (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "0,d,m")))]
  "TARGET_64BIT"
  "@
   #
   move\t%0,%1
   lw\t%0,%1"
  "&& reload_completed
   && GET_CODE (operands[0]) == REG
   && GET_CODE (operands[1]) == REG
   && REGNO (operands[0]) == REGNO (operands[1])"
  [(const_int 0)]
{
  emit_note (NOTE_INSN_DELETED);
  DONE;
}
  [(set_attr "type" "arith,arith,load")
   (set_attr "mode" "DI")])

through the same code-comparison test, using the applied patch as
a baseline.  Results were:

 24 files changed, 78 insertions(+), 63 deletions(-)

The only file to get shorter was the one that got longer last time.
All the rest were the same or longer (due to extra "move" insns).

Richard



More information about the Gcc-patches mailing list