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: RFA: patch for PR42973


On Wed, Feb 10, 2010 at 5:53 PM, Vladimir Makarov <vmakarov@redhat.com> wrote:
> Steven Bosscher wrote:
>>
>> On Tue, Feb 9, 2010 at 9:00 PM, Vladimir Makarov <vmakarov@redhat.com>
>> wrote:
>>
>>>
>>> + ?for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
>>> + ? ?if (REG_NOTE_KIND (link) == REG_DEAD)
>>> + ? ? ?break;
>>> + ?if (! link)
>>> + ? ?return;
>>>
>>
>> What is the purpose of this code? Obviously you're looking for a
>> REG_DEAD note, but you're not looking at this note anywhere to see
>> which reg dies.
>>
>
> If there are no REG_DEAD notes, there is no sense to try copy generation.
> ?The code in the function after the mentioned code is expensive. ?So major
> purpose of the code fragment is to speed up constraint and shuffle copy
> generation.
>

OK, perhaps it's just me, but I didn't understand that from the code.
Could you add a comment there?

Also, note you should do:

  if (! find_reg_note (insn, REG_DEAD, NULL))
    ...

instead of the loop.

Ciao!
Steven


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