On 04/29/2014 01:59 AM, Tom de Vries wrote: > On 24-04-14 17:13, Eric Botcazou wrote: >>> The hook is called right after expansion of calls, and allows a target to do >>> additional processing, such as f.i. adding clobbers to >>> CALL_INSN_FUNCTION_USAGE. >>> >>> Instead of using the hook, we could add code to the preparation statements >>> operand of the different call expands, but that requires those expands not >>> to use the rtl template, and generate all the rtl through c code. Which >>> requires a rewrite of the call expands in case of Aarch64. >> >> If Aarch64 is the only problematic back-end, then it should be changed to do >> what the other back-ends already do to use use_reg. IMO adding such a bogus >> hook should be the very last resort solution. >> > > Eric, > > I've written this concept patch, which tries to address the same problem, but > in a different (and I hope more generic) way. > > It adds a post-emission C-code operand to define_expand. > > As an example of how this could be useful, for the define_expand of call and > call_value in the arm target, I'm using the new operand to do the post-emit > call processing done currently in arm_emit_call_insn. This allows us to > eliminate the call_internal and call_value_internal define_expands, and > simplifies the call and call_value define_expands.
Is this patch really any better? I can't see that it is myself. It seems to me that the existing mechanism to emit the call, then append to FUNCTION_USAGE is perfectly clear. This new argument to define_expand seems less clear. What are you trying to fix, anyway? r~