[MachineOutliner][AArch64] Save + restore LR in noreturn functions
authorJessica Paquette <jpaquette@apple.com>
Tue, 7 Jan 2020 19:12:32 +0000 (11:12 -0800)
committerJessica Paquette <jpaquette@apple.com>
Tue, 7 Jan 2020 19:27:25 +0000 (11:27 -0800)
commitacd258082477b8a4edf3037127efb5fed4494da3
treea2bc78944f00807886d035b193d664e141724e76
parentafa8211e979c25100c2ed41d8da1e18b45d0ef2b
[MachineOutliner][AArch64] Save + restore LR in noreturn functions

Conservatively always save + restore LR in noreturn functions.

These functions do not end in a RET, and so they aren't guaranteed to have an
instruction which uses LR in any way. So, as a result, you can end up in
unfortunate situations where you can't backtrace out of these functions in a
debugger.

Remove the old noreturn test, and add a new one which is more descriptive.

Remove the restriction that we can't outline from noreturn functions as well
since we now do the right thing.
llvm/lib/CodeGen/MachineOutliner.cpp
llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
llvm/test/CodeGen/AArch64/machine-outliner-noreturn-save-lr.mir [new file with mode: 0644]
llvm/test/CodeGen/AArch64/machine-outliner-noreturn.mir [deleted file]