- User Since
- Sat, Feb 3, 5:52 PM (2 w, 2 d)
Fri, Feb 16
Tue, Feb 13
Thu, Feb 8
Added a comment about setjmp/longjmp and CSR spills.
I did think about that, but came to the conclusion that longjmp would have to restore all callee-saves to the state they had at setjmp, and that setjmp would have to store them into the jmp_buf. If longjmp uses CSR spills the transform is indeed unsound, but I'm not sure how it would access those without being an llvm builtin. I've checked with what musl does on ARM (because that's what I'm familiar with) to confirm that idea, so at least on ARM the transform should be safe?
Tue, Feb 6
Added a target hook to enable CSR spill skipping, default off and enabled currently only for ARM because that's what I know best.
I would rather make it generic, not break debug, and habe the user decide whether or not to apply this. If libraries are the concern it probably can't be the target's decision either. Would enabling the transform only with fp-elim and a cl option be just as good?
If I understand the IR correctly then this would either involve some nasty inline assembly or some form of tail call. If the target were not itself nonreturning, then the caller could also not be, so the transform would not apply.
Can you elaborate on that? I'm primarily interested in programs that do not terminate at all, with nested nonreturning functions. How would not saving CSRs in the outer nonreturning function prolog affect the inner nonreturning function? The only affected thing that comes to my mind right now is a debugger.
Mon, Feb 5
Restricated CSR save skip to noreturn nounwind functions from previously noreturn. Exception handlers might need CSRs restored.