[PATCH] D42898: Do not spill CSR to stack on entry to noreturn functions

Francis Visoiu Mistrih via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 5 15:51:22 PST 2018


thegameg added a comment.

In https://reviews.llvm.org/D42898#998355, @efriedma wrote:

> It looks like this transform destroys stack traces on non-x86 platforms.  That technically isn't wrong, I guess, but it seems unfriendly (for example, LLVM produces a stack trace on an assertion failure).


I might be wrong but I think at least the ARM and AArch64 backend would still save FP+LR. After calling `TargetFrameLowering::determineCalleeSaves`, FP and LR are usually added to the list of registers to be saved by the target in the target-specific `determineCalleeSaves`. From what I can see after a quick glance all the backends (except ARC and Sparc? not sure) special-case FP and LR (or whatever equivalent).

I do agree that if this breaks stack traces it should be under some flag or something.


https://reviews.llvm.org/D42898





More information about the llvm-commits mailing list