> On Aug 6, 2020, at 3:31 AM, Richard Biener <rguent...@suse.de> wrote:
> 
> On Wed, 5 Aug 2020, Qing Zhao wrote:
> 
>> Hi, Richard,
>> 
>> Thanks a lot for your careful review and detailed comments.  
>> 
>> 
>>> On Aug 4, 2020, at 2:35 AM, Richard Biener <rguent...@suse.de 
>>> <mailto:rguent...@suse.de>> wrote:
>>> 
>>> I have a few comments below - I'm not sure I'm qualified to fully
>>> review the rest though.
>> 
>> Could you let me know who will be the more qualified person to fully review 
>> the rest of middle-end change?
> 
> Jeff might be, but with the intended purpose (ROP mitigation AFAIU)
> it would be nice for other target maintainers to chime in (Segher for
> power maybe) for the question below...
> 
>>>>>>> +      if (!targetm.calls.zero_call_used_regno_p (regno, gpr_only))
>>>>>>> +     continue;
>>> 
>>> Why does the target need some extra say here?
>> 
>> Only target can decide which hard regs should be zeroed, and which hard regs 
>> are general purpose register. 
> 
> I'm mostly questioning the plethora of target hooks added and whether
> this details are a good granularity applying to more than just x86.
> Did I suggest to compute a hardreg set that the middle-end says was
> used and is not live and leave the rest to the target?

Yes, I agree that there might be too much details exposed to middle-end in the 
current design. 

A single target hook as you suggested:
 targetm.calls.zero_regs (used-not-live-hardregset, gpr_only);

Might be a cleaner design.


Thanks.

Qing

Reply via email to