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] [RFC, GCC 4.8] Optimize conditional moves from adjacent memory locations


On Fri, 2012-02-24 at 15:41 -0600, William J. Schmidt wrote:
> On Fri, 2012-02-10 at 15:46 -0500, Michael Meissner wrote:
> > I was looking at the routelookup EEMBC benchmark and it has code of the form:
> > 
> >    while ( this_node->cmpbit > next_node->cmpbit )
> >     {
> >       this_node = next_node;
> > 
> >       if ( proute->dst_addr & (0x1 << this_node->cmpbit) )
> >          next_node = this_node->rlink;
> >       else
> >          next_node = this_node->llink;
> >     }
> > 
> 
> Andrew and Richard both suggested this would be better handled as a tree
> optimization.  Here is a proposed patch to do that.  

I think this is slightly different from what was suggested by me.  Since
my suggestion has to deal with the load from this_node->cmpbit taken
into account and not just because this_node->rlink and this_node->llink
might be in the same page.

Thanks,
Andrew Pinski


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