This is the mail archive of the gcc@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]

Re: comments on loop changes


Michael Hayes writes:
 > I've found I can emulate the behaviour of the Sparc by setting
 > ADDRESS_COST to 1.  I then get essentially the same pattern of GIVs
 > and the GIV combination works well.

With the Sparc we get the following expressions which the giv combiner
does the right thing:

ra = biv * 8
*(ra + rb)
*(ra + rc)
rd = ra + rb
re = ra + rc
*(rd + 4)
*(re + 4)

However, if a reg+reg addressing cost is higher than a reg addressing
cost (as on the c4x), CSE turns the above into:

ra = biv * 8
rd = ra + rb
re = ra + rc
*rd
*re
*(rd + 4)
*(re + 4)

Unfortunately, giv combination does the wrong thing with this.
The upshot is, if the address costs try to discourage reg+reg
addressing modes, there is a greater chance of generating them!

Michael.



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