Redundant instructions in loop optimization for x86-64?

Jan Hubicka jh@suse.cz
Sat Sep 11 11:51:00 GMT 2004


> On Fri, Sep 10, 2004 at 11:50:23AM +0200, Jan Hubicka wrote:
> > > It seems that gcc 3.4 and 4.0 generate redundant instructions in loop
> > > optimization for x86-64:
> > > 
> > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17387
> > > 
> > > Does anyone know why?
> > 
> > It is a zero extension GCC believe to be essential.
> 
> Is there a way to tell gcc that 32bit zero extension isn't needed for
> x86-64?

GCC partly knows about this via combine pattern (ie if the computation
of the value is directly preceeding 32bit operation, it should get these
combined as there are combine patterns for it.

In this case GCC thinkgs that both zero extended and not-zero extended
values are needed (one for addressing, other for next iteration) and
thus combine won't try it.
Of course this is just stupid as both values can live in the same
registers - if we had pass noticing this and converting the later use
into subreg, we would get this optimized out.
Perhaps the pass to elliminate more extension posted somewhere can take
care of this.
> 
> 
> H.J.



More information about the Gcc mailing list