-fuse-caller-save - Collect register usage information
Tom de Vries
Tom_deVries@mentor.com
Thu Jun 19 12:40:00 GMT 2014
On 19-06-14 07:13, Richard Henderson wrote:
> On 05/19/2014 07:30 AM, Tom de Vries wrote:
>> >+ for (insn = get_insns (); insn != NULL_RTX; insn = next_insn (insn))
>> >+ {
>> >+ HARD_REG_SET insn_used_regs;
>> >+
>> >+ if (!NONDEBUG_INSN_P (insn))
>> >+ continue;
>> >+
>> >+ find_all_hard_reg_sets (insn, &insn_used_regs, false);
>> >+
>> >+ if (CALL_P (insn)
>> >+ && !get_call_reg_set_usage (insn, &insn_used_regs, call_used_reg_set))
>> >+ {
>> >+ CLEAR_HARD_REG_SET (node->function_used_regs);
>> >+ return;
>> >+ }
>> >+
>> >+ IOR_HARD_REG_SET (node->function_used_regs, insn_used_regs);
>> >+ }
> As an aside, wouldn't it work out better if we collect into a local variable
> instead of writing to memory here in node->function_used_regs each time?
Richard,
Agreed. This patch implements that. I'll bootstrap and reg-test on x86_64 and
commit as obvious.
Thanks,
- Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-Use-function_used_regs-variable-in-collect_fn_hard_r.patch
Type: text/x-patch
Size: 1813 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140619/edec5feb/attachment.bin>
More information about the Gcc-patches
mailing list