This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Rest of Intel Atom optimization


On Sat, Apr 18, 2009 at 11:18 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> H.J. Lu wrote:
>>
>> On Mon, Apr 6, 2009 at 11:14 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
>>
>>>>
>>>> Can extract_insn_cached help here?
>>>>
>>>
>>> You can look at ix86_attr_length_address_default, there is
>>> get_attr_type, used to detect TYPE_LEA.
>>>
>>>
>>
>> Here is the rest of Intel Atom optimization. OK for trunk?
>>
>
>> +static int
>> +distance_non_agu_define (rtx op1, rtx op2, rtx insn)
>> +{
>> + ?unsigned int regno1 = REGNO (op1);
>> + ?unsigned int regno2 = REG_P (op2) ? REGNO (op2) : (unsigned int) -1;
>
> Hm, not true_regnum in the lines above?

We know op1 is a register and op2 isn't a subreg.  Do
we need to call  true_regnum?

>
> (BTW: You can use INVALID_REGNUM for invalid regnumbers).

I checked the patch into Atom branch to use INVALID_REGNUM.

>> + ?basic_block bb = BLOCK_FOR_INSN (insn);
>> + ?int distance = 0;
>> + ?df_ref *def_rec;
>
> ...
>
>> + ? ? ? ? ? ? ? ? {
>> + ? ? ? ? ? ? ? ? ? insn_type = get_attr_type (prev);
>> + ? ? ? ? ? ? ? ? ? if (insn_type != TYPE_LEA)
>> + ? ? ? ? ? ? ? ? ? ? goto done;
>> + ? ? ? ? ? ? ? ? }
>
> ...
>
>> +done:
>> + ?/* Restore recog_data which may be modified by get_attr_type. ?*/
>> + ?extract_insn_cached (insn);
>> + ?return distance;
>
>
> This can't be right. You are restoring recog data on a different insn that
> was processed by get_attr_type. I think that extract_insn_cached should
> immediately follow get_attr_type in order to restore recog data.
>

We want to restore recog data on the instruction, which is the
parameter, INSN, on which distance_non_agu_define is called.
INSN is unchanged here. Did I miss something?

Thanks.

-- 
H.J.

Attachment: gcc-atom-invalid-1.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]