This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [G]CSE of extended asm statements
On Wed, Aug 30, 2000 at 07:27:43PM +0100, Bernd Schmidt wrote:
> Think of the bugs we are having for example with match_dups in SSA. This
> is IMO the same problem - rtl allows something that is kind of useful for
> a port or two, but could be achieved in other ways as well (e.g. matching
> constraints), and it immediately becomes much harder to just take an
> algorithm from a compiler book and implement it in gcc.
Point taken.
> What would prevent us from allowing call patterns to look e.g. like
>
> (parallel
> [(call foo)
> (set (reg:SI returnreg1) (call_result:SI 1)
> (set (reg:SF returnreg2) (call_result:SF 2)
> ....
> ])
>
> I wouldn't call it very pretty either, but it's less likely to give
> optimization passes a hard time - all the sets are easily recognizable
> in a format that is used by all the other insns. It's basically an
> UNSPEC in disguise, and we already have UNSPECs.
That looks fairly reasonable. And extends fairly well to asms
as well, with something like
(parallel
[(asm_input "code"
[(reg:SI in0) (reg:SI in1) (mem:SI in2)]
["r" "r" "m"])
(set (reg:SI out0) (asm_result:SI "=r"))
(set (reg:SF out1) (asm_result:SF "=f"))
])
It would take a bit of cleanup work elsewhere in the compiler, but
it does seem like something worth doing.
r~