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

[Bug rtl-optimization/46920] suboptimal register allocation with local register variables


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46920

--- Comment #2 from Paolo Bonzini <bonzini at gnu dot org> 2010-12-14 08:21:33 UTC ---
> To generate the proposed code, we should assign r12 to p63. ÂIRA marks p63
> conflicting with r12 because DF-infrastructure reports r12 having intersected
> live ranges with p63.
>
> It is possible to solve the problem if we have conflicts based on values (not
> live ranges). ÂI'd not recommend to do that, because it will slow down RA
> without visible improvement on majority benchmarks (I did such experiment about
> 7 years ago and reported about the results on GCC summit in 2004).

One alternative is to rematerialize values that have been copied to a
hard register before their uses (by inserting an r12:DI=r63:DI before
the use of r63).  This breaks the live ranges of the pseudos and
facilitates coalescing.

> By the way, usage of implicit hard registers in RTL (when it can be avoided.
> Example when hard registers can be avoided is their usage as call arguments) is
> very bad idea for RA. ÂI see it a lot such code in x86-64 code. ÂI'd recommend
> to prevent optimizations before RA to abuse hard register usage.

As I said, the improvement from hard register variable here is 25% on
x86-64 and probably more (I can collect data) on i386.  This testcase
is distilled from a bytecode interpreter.


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