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]
Other format: [Raw text]

Re: Minor issue with recent code to twiddle costs of pseudos with invariant equivalents


On 06/11/2010 06:32 PM, Jeff Law wrote:

> But shouldn't having an invariant form just decrease the priority
> for pseudo 59 to get a hard register?  The NO_REGS preferencing will
> totally disable register allocation for pseudo 59.

And that's intended, because from the costs we've concluded that it's
better _not_ to allocate a hard reg to this pseudo.

> Just because we have an invariant equivalent form doesn't mean we
> should totally disable allocation -- if a hard reg is available,
> we're sometimes going to be better off using a hard reg to hold the
> value rather than substituting the equivalent form at each use of the
> pseudo.

Please look at the testcases in the PRs referenced in my checkin -
PR42500, 42502, 39871 and 40615.  In each of these cases, we can improve
allocation by not giving out a hard reg for the pseudo involved.

The new code is intended to calculate the costs of not using a hard
register, and uses these costs instead of generic memory costs in IRA.
If they are lower than the costs for any register class, we prefer not
to allocate the reg.


Bernd


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