Move insn out of the way
Vladimir Makarov
vmakarov@redhat.com
Fri Aug 12 14:22:00 GMT 2011
On 08/12/2011 06:00 AM, Paulo J. Matos wrote:
> On Thu, Aug 11, 2011 at 3:27 PM, Vladimir Makarov<vmakarov@redhat.com> wrote:
>> Yes, that is mostly correct. The first could be done by -fweb (if the live
>> range where the pseudo is equal to the constant is disjoint). The first
>> could be done also by Jeff Law's project which can provide splitting not
>> only on the border of loops.
>>
> I was thinking that one possible solution in the short term would be
> to add a new pass just before IRA which does constant assignment
> moves. So, an insn where a register which is assigned a constant can
> be moved as much as possible to the place right before the use of the
> register or if there's no use of the register inside the current BB,
> it can be moved as the last instruction of the BB.
>
> What do you think about this? Would this work? I know it's not very
> general, however, it's useful at least for my backend to get this
> right as soon as possible due to several size test failures we have
> which are a consequence of this problem.
Sorry, Paulo. I don't think it is a good idea to have such a general
pass. A constant depending on its value could be prohibited to be used
in insn. Moving assignment to the constant most probably worsens insn
schedule on targets where the 1st insn scheduling is a default.
But moving the pass before 1st insn scheduling could work if register
pressure sensitive insn scheduling is used. Still it is too specialized
pass. I think register pressure relief as it is described in Simpson's
thesis would be a more general approach.
But to be honest, I think, the best solution would be in RA because it
is dealing with insn constraints and costs. I'll think about solving
this problem in RA.
More information about the Gcc
mailing list