[PATCH] lower-subreg: Decompose multiword shifts
Michael Matz
matz@suse.de
Fri Aug 3 15:37:00 GMT 2007
Hi,
On Fri, 3 Aug 2007, Andreas Krebbel wrote:
> With and without my patch lower subreg decomposes the following
> clobber insn:
>
> (insn 12 9 10 2 t.c:6 (clobber (reg:DI 61)) -1 (expr_list:REG_LIBCALL_ID (const_int 0 [0x0])
> (insn_list:REG_LIBCALL 13 (nil))))
That's the required introducing insn of a libcall sequence dealing with
subregs of multi-word regs, so ...
> into:
>
> (insn 12 29 30 2 t.c:6 (clobber (reg:SI 67)) -1 (expr_list:REG_LIBCALL_ID (const_int 0 [0x0])
> (nil)))
>
> (insn 30 12 10 2 t.c:6 (clobber (reg:SI 68 [+4 ])) -1 (nil))
... this would be wrong of lower-subreg. I thought it handled libcall
sequences correctly, Ian? If lower-subreg manages to decompose _all_
writing subreg references in the libcall sequence then the whole libcall
structure can and should be removed (which includes the introducing
clobber and the finishing self-move (with the RETVAL note)). Removing
only part of that structure is going to cause confusion later on (as
here).
> I've tried to copy the REG_LIBCALL_ID note to the second clobber in
> lower subreg and was hoping that DCE then would be able to remove the
> libcall block as a whole but this didn't work.
As the clobber misses the REG_LIBCALL note (pointing to the end insn of
the whole libcall sequence) I don't think the REG_LIBCALL_ID notes
establish anything interesting. Or well, they do make DCE note that all
insns with the same ID are required, when one of such is required. But
from the looks of it they won't be deleted as a libcall sequence if the
REG_LIBCALL or REG_RETVAL notes are missing (delete_unmarked_insns).
> But since this clobber is probably just issued to make it explicit
> that the whole multiword register is written by the libcall
That's correct.
> I think after decomposing that multiword register we can safely remove
> the clobber insn anyway - right?!
If lower-subreg was able to decompose all writes into subregs of the
clobbered reg in that libcall sequence, then yes. I don't know if
lower-subreg ever is not able to do that once it determined that it can
start transforming at all.
Ciao,
Michael.
More information about the Gcc-patches
mailing list