lenary wrote:

> The two additional instructions are a store and a load to preserve and 
> restore `t0`. The extra stack space comes from its 4-byte (RV32) or 8-byte 
> (RV64) spill slot, rounded up as needed to maintain 16-byte stack alignment.

How avoidable is spilling the `mepc` value in `t0` - presumably if the function 
doesn't otherwise touch `t0`, we could just leave it in the register until it 
is needed again?

Maybe this is a follow-up we can do to reduce the instructions in the empty 
handler and in handlers that don't use `t0`.

---

This looks a bit tidier than what we had before, thank you.

Yes we can follow up with more CFI fixes later, getting the GPRs right is most 
important IMO (followed by getting the return address right, which we don't 
generally manage in any interrupt handler yet).

---

I am doing some work on patches dealing with the lambdas whose type you changed 
in 
[0e3b162](https://github.com/llvm/llvm-project/pull/221318/commits/0e3b162cfacbac3cd323aaed9206a01a2c7b4462)
 - it would be better if you could use `ArrayRef<CalleeSavedInfo>` rather than 
`decltype`, as we end up dealing with more than just SmallVectors.

I do wonder if we need a better name for your hook that gets the unmanaged, 
non-t0 CSI. I don't know if we want to say scalar in it just in case it gets 
other kinds of state too. Can we maybe call it `getUnmanagedInterruptCSI` or 
something?



https://github.com/llvm/llvm-project/pull/221318
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to