This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH, IRA] Fix ALLOCNO_MODE in the case of paradoxical subreg.
- From: Vladimir Makarov <vmakarov at redhat dot com>
- To: Wei Mi <wmi at google dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, David Li <davidxl at google dot com>
- Date: Wed, 25 Sep 2013 15:30:03 -0400
- Subject: Re: [PATCH, IRA] Fix ALLOCNO_MODE in the case of paradoxical subreg.
- Authentication-results: sourceware.org; auth=none
- References: <CA+4CFy73kNt8naM0Ds_8q7cpCn77aTtVRgCHUBiSFacJMQ+L7g at mail dot gmail dot com> <524304C2 dot 1040304 at redhat dot com> <CA+4CFy7APRWjyjAecTQoo=S-+5f0G79Xa_My77eYQiJ1HBkr-g at mail dot gmail dot com> <52431B06 dot 4050405 at redhat dot com> <CA+4CFy7ShZXmcNuuiEGAbBLtRJTJgJ5cMMLhJETxjJz7=N=BmQ at mail dot gmail dot com>
On 09/25/2013 02:00 PM, Wei Mi wrote:
>> To define for what occurrence of the pseudo we should do the
>> transformation, we need to create allocnos and calculate reg classes to
>> know what paradoxical subreg needs more hard regs (the transformations
>> can not be done for all paradoxical subregs as my experience shows many
>> RTL changes result in worse RA even if we have heuristics to remove the
>> generated changes as in this case would be trying to assign the same
>> hard reg for the original and the new pseudo).
>> After doing the transformations, we need to recalculate reg classes
>> and rebuild allocnos (both are expensive). To speed up the process it
>> could be implemented as some kind of update of already existing data but
>> it will complicate code much.
> I see, thanks!
>> So right now I think implementing this in LRA would be easier Still LRA
>> has a pretty good register (re-)allocation (although it is worse than in
> When you get an idea how to fix it in LRA, if you are still busy, I
> would be happy to do the implementation if you could brief your idea.
Probably the best place to add a code for this is in
lra-constraints.c::simplify_operand_subreg by permitting subreg reload
for paradoxical subregs whose hard regs are not fully in allocno class
of the inner pseudo.
It needs a good testing (i'd check that the generated code is not
changed on variety benchmarks to see that the change has no impact on
the most programs performance) and you need to add a good comment
describing why this change is needed.