https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69847

--- Comment #10 from Vladimir Makarov <vmakarov at gcc dot gnu.org> ---
I've been working on this for about 2 weeks and still I don't see the problem
will be solved soon.  Therefore I've decided to write some update.

First of all after analyzing hot functions, I found that LRA generates more
code to load high parts of addresses than the reload pass.  Digging into the
reload pass I found that the reload does an inheritance beyond memory
load/stores and reuse values in pseudos containing an address high part where
it is possible.  This functionality is missed in LRA.  I started to think how
to better implement it in LRA (inheritance or rematerialization) but I came to
the conclusion that the inheritance is the only way to do this. Unfortunately,
inheritance in LRA is a complicated thing and I need to make it even more
complicated.

I almost finished the implementation of the inheritance beyond the spills. 
Unfortunately, I found that even LRA generates fewer insns and loads of address
high parts for the code examples, there are still additional reg-reg moves in
comparison with the code generated by the reload pass.  I think removing these
additional moves will require changes in LRA assignment sub-pass.  Currently
LRA assigns hard registers to reload pseudos first (to guarantee they will get
hard registers in any case) and then to inheritance pseudos.  To remove the
moves, assignment to reload pseudos and inheritance pseudos connected to the
reload pseudos should be assigned at the same time (or one immediately after
another).  It means that we need to able to spill the inheritance pseudos (or
assign it to other registers) if another reload pseudo needs an inheritance
pseudo register.

So I am going to try this new assignment scheme.  ETA for this is June-July.

Reply via email to