This is the mail archive of the
mailing list for the GCC project.
Re: lower subreg optimization
On 04/07/2010 10:48 PM, roy rosen wrote:
I saw in arm/neon.md that they have a similar problem:
Their solution is also not complete.
What is the proper way to handle such a case and how do I let gcc know
that this is a simple move instruction so that gcc would be able to
optimize it out?
The only simple solution at the moment is the one that the ARM port is
using. You avoid emitting the move when you got the lucky reg-alloc
result, and you emit the move when you aren't lucky.
As the neon.md comment suggests, and as Ian Taylor mentioned in his
response, a possible solution is to modify the lower-subreg.c pass
somehow so that it no longer splits subregs of vector modes, possibly
controlled by a hook.
We might be able to modify the register allocator to look for this
pattern, to increase the chances of getting the good reg-alloc result,
but the lower-subreg.c change is probably better.
Another solution might be to add a pass (or modify an existing one like
regmove.c) to try to put things back together again, but this is
probably also not as good as the lower-subreg.c change.