On 07/18/2011 04:14 PM, Richard Henderson wrote:
On 07/18/2011 12:15 PM, Georg-Johann Lay wrote:
However, what you've done is try very hard to work around reload
doing the Right Thing with constant spilling, namely re-generate
the constant rather than spill and restore it. I cannot believe
that's the right way to proceed.
You mean that with a clobber reload will rematerialize the constant
if there are not enough registers instead of spilling it?
And with an ordinary move like
(set (reg) (const_int))
reload will not see that it can reaterialize it and spill it to
the stack?
Well, it certainly didn't use to.
Vlad, do you know what the current state of the register allocator
is wrt this sort of rematerialization?
Rematerialization is done in reload. So it is the same as it was before
IRA.
Reload should definitely rematerialize constants and I saw it many times
when I analyzed the code generated by IRA+reload.
It will also do rematerialization of 'a hard reg + const'.
Moreover, I wonder why target-independent code does not already
catch the situation because the pattern to be generated is just
an ordinary umulqihi3 widening multiplication.
Yes, it is sad that the backends have to work around the fact
that sign/zero_extension of constants is invalid rtl.
r~