Avoid most of calls to canon_rtx

Jan Hubicka jh@suse.cz
Thu Mar 13 09:07:00 GMT 2003


> On Wed, Mar 12, 2003 at 02:47:09PM +0100, Jan Hubicka wrote:
> > +    Expect that X and Y has beel already canonicalized.
> 
> Typo.  And in the cut and pasted copy below.
> 
> The rtx_equal_for_memref_p change looks ok.
> 
> >     if (offset)
> > -     addr = gen_rtx_PLUS (GET_MODE (addr), XEXP (addr, 0), GEN_INT (offset));
> > +     addr = canon_rtx (gen_rtx_PLUS (GET_MODE (addr), XEXP (addr, 0),
> > + 		      GEN_INT (offset)));
> >     else
> > -     addr = XEXP (addr, 0);
> > +     addr = canon_rtx (XEXP (addr, 0));
> 
> Err, how about 
> 
> 	if (...)
> 	  addr =
> 	else
> 	  addr = 
> 	addr = canon_rtx (addr);
> 
> instead.
> 
> > - 	    return memrefs_conflict_p (xsize, canon_rtx (XEXP (x, 0)),
> > - 				       ysize, canon_rtx (XEXP (y, 0)), c);
> > + 	    return memrefs_conflict_p (xsize, XEXP (x, 0),
> > + 				       ysize, XEXP (y, 0), c);
> 
> I don't see how CONST guarantees that its contents are canonicalized?

My understanding is that we do just replace registers by constants, so
when we do have CONST we should not make any change in it.
I see that CONST may be noncannonical, so plus_constant may make some
difference, but then it is broken in MD file or not?

Honza
> 
> 
> r~



More information about the Gcc-patches mailing list