[RFA][PATCH][middle-end/53623] Improve extension elimination

Jeff Law law@redhat.com
Fri Dec 20 16:26:00 GMT 2013


On 12/20/13 01:24, Jakub Jelinek wrote:
>
> Thanks for working on this, the only thing I'd worry about are
> HARD_REGNO_NREGS > 1 registers if the two hard regs might overlap.
The reg_set_between_p and reg_used_between_p calls when you dig down 
into them eventually use reg_overlap_mentioned_p which should do the 
right thing in this regard.

I'll audit ree for problems of this nature.

>>
>> +  /* If the extension's source/destination registers are not the same
>> +     then we need to change the original load to reference the destination
>> +     of the extension.  Then we need to emit a copy from that destination
>> +     to the original destination of the load.  */
>> +  rtx new_reg;
>> +  bool copy_needed
>> +    = REGNO (SET_DEST (PATTERN (cand->insn)))
>> +	     != REGNO (XEXP (SET_SRC (PATTERN (cand->insn)), 0));
>
> Perhaps the right formatting here would be
>    bool copy_needed
>      = (REGNO (SET_DEST (PATTERN (cand->insn)))
>         != REGNO (XEXP (SET_SRC (PATTERN (cand->insn)), 0)));
> ? ()s for emacs, and aligning != under REGNO.
Agreed.  I was factoring out that test and didn't fix the formatting.

>
>> +  if (copy_needed)
>> +    new_reg = gen_rtx_REG (cand->mode, REGNO (SET_DEST (PATTERN (cand->insn))));
>
> Too long line.
Ugh.  80 exactly.  There are times I hate our conventions :(

jeff



More information about the Gcc-patches mailing list