This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: Faster for_each_rtx-like iterators
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 19 May 2014 19:46:32 +0100
- Subject: Re: RFC: Faster for_each_rtx-like iterators
- Authentication-results: sourceware.org; auth=none
- References: <87k39x48gu dot fsf at talisman dot default> <536C7345 dot 4010106 at redhat dot com> <87vbt4zwnu dot fsf at talisman dot default> <537A4B2C dot 9060002 at redhat dot com>
Jeff Law <law@redhat.com> writes:
> On 05/17/14 01:33, Richard Sandiford wrote:
>> I suppose we could put the onus on the users of the iterator to invoke
>> a "handle subrtxes of this code" routine once they know what the code is.
>> That could make things a bit ugly though. E.g.:
>>
>> FOR_EACH_SUBRTX (iter, array, expr, NONCONST)
>> if (GET_CODE (*iter) == VALUE && CSELIB_VAL_PTR (*iter)->uid > minuid)
>> return true;
>>
>> would become:
>>
>> FOR_EACH_SUBRTX (iter, array, expr, NONCONST)
>> if (GET_CODE (*iter) == VALUE)
>> {
>> if (CSELIB_VAL_PTR (*iter)->uid > minuid)
>> return true;
>> iter.code_is (VALUE);
>> }
>>
>> It began to feel like premature optimisation.
> Understood. Thanks for poking at it.
>
> There's something about FOR_EACH_RTX that feels like it needs a rethink,
> but I haven't managed to put my head around it yet. I'll put it away
> for a while.
>
> So as far as the patch itself is concerned, are there any outstanding
> issues?
No, I just need to find time to brush off the patches and submit them
properly (looks there are 57 in all). Hope to do that in the next
week or so.
Thanks for the reviews.
Richard