This is the mail archive of the
mailing list for the GCC project.
Re: RFC: lra-constraints.c and TARGET_HARD_REGNO_CALL_PART_CLOBBERED question/patch
On Thu, 2018-07-12 at 07:17 +0100, Richard Sandiford wrote:
> So it only calls targetm.hard_regno_call_part_clobbered if such a
> call is known to exist somewhere between the two references to
> regno (although we don't have the calls themselves to hand).
Having the specific calls is the problem here because the normal ABI
and the SIMD ABI are going to have different values for caller_save
and part_clobbered. But I think I have found a better way to address
Looking at 'need_for_call_save_p', when 'flag_ipa_ra' is set, we look
at 'actual_call_used_reg_set' to see if we need to save a
register. But even if a particular register doesn't show up as used,
if 'hard_regno_call_part_clobbered' is set for that register we are
going to return true and say we need a save/restore of the
register. On Aarch64, if I 'really' didn't use the register I
shouldn't need to save/restore it. If I used it but it is callee saved
then on 'normal' functions I may need to save/restore it (to protect
the upper bits) but on SIMD functions I do not need to save/restore it
at all because the callee will save/restore the entire register and not
just the lower 64 bits.
I think that the patch I want to create is: when 'flag_ipa_ra' is true,
remove the check of 'hard_regno_call_part_clobbered' from
'need_for_call_save_p'. Instead, check
'hard_regno_call_part_clobbered' in 'process_bb_lives' (where we know
exactly what function is being called) and use that to set
'actual_call_used_reg_set'. In process_bb_live we know exactly what
function we are calling and can check to see if it is a 'normal'
function or a SIMD function.