On 8/20/24 2:42 AM, Richard Sandiford wrote:
Vineet Gupta <[email protected]> writes:
On 8/19/24 14:52, Richard Sandiford wrote:
2. On RISC-V sched1 is counter intuitively assuming HARD_FP is live due to the 
weird interaction of DF infra (which always marks HARD_FP with
artificial def) and ira_no_alloc_regs.
In general, it isn't possible to predict at this stage whether the hard
frame pointer will be needed, even for -fomit-frame-pointer.  The final
decision is made during LRA, which in the worst case has iterate through
several elimination attempts.

So whatever we do here will be wrong for some cases.  In some ways,
assuming that the hard frame pointer will be needed is the conservative
option; if we instead assumed that it wasn't needed, we'd be more
willing to move code around to make use of that (supposed) extra register.

Right, but we can tweak sched1 heuristics some more :-)
What if just for model pressure calculations we ignore these artificial defs 
and FP semantics from RA pov remain unchanged.

But my point was that:

- the sched1 code doesn't know whether FP will be needed
- assuming that the FP will be needed should lead to a higher
   pressure estimate
- a higher pressure estimate should lead to more caution
- in general, more caution leads to less spilling
Agreed on all points.  This aspect is a total red herring IMHO.

Jeff

Reply via email to