Re: RFC: Faster for_each_rtx-like iterators

2014-05-19 Thread Richard Sandiford
Jeff Law 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,

Re: RFC: Faster for_each_rtx-like iterators

2014-05-19 Thread Jeff Law
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 (

Re: RFC: Faster for_each_rtx-like iterators

2014-05-17 Thread Richard Sandiford
Thanks for the comments. Jeff Law writes: >> Implementation-wise, the main observation is that most subrtxes are part >> of a single contiguous sequence of "e" fields. E.g. when compiling an >> oldish combine.ii on x86_64-linux-gnu with -O2, we iterate over the >> subrtxes of 7,636,542 rtxes. O

Re: RFC: Faster for_each_rtx-like iterators

2014-05-09 Thread Richard Biener
On Fri, May 9, 2014 at 8:18 AM, Jeff Law wrote: > On 05/07/14 14:52, Richard Sandiford wrote: >> >> I noticed for_each_rtx showing up in profiles and thought I'd have a go >> at using worklist-based iterators instead. So far I have three: >> >>FOR_EACH_SUBRTX: iterates over const_rtx subrtxes

Re: RFC: Faster for_each_rtx-like iterators

2014-05-08 Thread Jeff Law
On 05/07/14 14:52, Richard Sandiford wrote: I noticed for_each_rtx showing up in profiles and thought I'd have a go at using worklist-based iterators instead. So far I have three: FOR_EACH_SUBRTX: iterates over const_rtx subrtxes of a const_rtx FOR_EACH_SUBRTX_VAR: iterates over rtx subrt

Re: RFC: Faster for_each_rtx-like iterators

2014-05-08 Thread Trevor Saunders
On Thu, May 08, 2014 at 07:25:50AM +0100, Richard Sandiford wrote: > Trevor Saunders writes: > > On Wed, May 07, 2014 at 09:52:49PM +0100, Richard Sandiford wrote: > >> I noticed for_each_rtx showing up in profiles and thought I'd have a go > >> at using worklist-based iterators instead. So far I

Re: RFC: Faster for_each_rtx-like iterators

2014-05-07 Thread Richard Sandiford
Richard Sandiford writes: > Trevor Saunders writes: >> On Wed, May 07, 2014 at 09:52:49PM +0100, Richard Sandiford wrote: >>> I noticed for_each_rtx showing up in profiles and thought I'd have a go >>> at using worklist-based iterators instead. So far I have three: >>> >>> FOR_EACH_SUBRTX: it

Re: RFC: Faster for_each_rtx-like iterators

2014-05-07 Thread Richard Sandiford
Trevor Saunders writes: > On Wed, May 07, 2014 at 09:52:49PM +0100, Richard Sandiford wrote: >> I noticed for_each_rtx showing up in profiles and thought I'd have a go >> at using worklist-based iterators instead. So far I have three: >> >> FOR_EACH_SUBRTX: iterates over const_rtx subrtxes of

Re: RFC: Faster for_each_rtx-like iterators

2014-05-07 Thread Trevor Saunders
On Wed, May 07, 2014 at 09:52:49PM +0100, Richard Sandiford wrote: > I noticed for_each_rtx showing up in profiles and thought I'd have a go > at using worklist-based iterators instead. So far I have three: > > FOR_EACH_SUBRTX: iterates over const_rtx subrtxes of a const_rtx > FOR_EACH_SUBRTX

Re: RFC: Faster for_each_rtx-like iterators

2014-05-07 Thread Mike Stump
On May 7, 2014, at 1:52 PM, Richard Sandiford wrote: > > I've locally replaced all for_each_rtx calls in the generic code with > these iterators and they make things reproducably faster. The speed-up > on full --enable-checking=release ./cc1 and ./cc1plus times is only about 1%, > but maybe tha

RFC: Faster for_each_rtx-like iterators

2014-05-07 Thread Richard Sandiford
I noticed for_each_rtx showing up in profiles and thought I'd have a go at using worklist-based iterators instead. So far I have three: FOR_EACH_SUBRTX: iterates over const_rtx subrtxes of a const_rtx FOR_EACH_SUBRTX_VAR: iterates over rtx subrtxes of an rtx FOR_EACH_SUBRTX_PTR: iterates ov