[ARM][MachineOutliner] Emit more CFI instructions
authorMomchil Velikov <momchil.velikov@arm.com>
Mon, 9 Nov 2020 11:48:32 +0000 (11:48 +0000)
committerMomchil Velikov <momchil.velikov@arm.com>
Mon, 9 Nov 2020 15:26:18 +0000 (15:26 +0000)
commit937ab6a7853ddb65373edec77f6d86741106cefb
tree4fecaa0923218811bacdf04e2382a5273515babe
parentbbc3e03032c5aa178c52e78a6c221ef0c6e249ca
[ARM][MachineOutliner] Emit more CFI instructions

This patch make the outliner emit CFI instructions in a few more
places:

  * after LR is restored, but before the return in an outlined
  function

  * around save/restore of LR to/from a register at calls to outlined
  functions

  * around save/restore of LR to/from the stack at calls to outlined
  functions

The latter two only when the function does NOT spill LR. If the
function spills LR, then outliner generated saves/restores around
calls are not considered interesting for unwinding the frame.

Differential Revision: https://reviews.llvm.org/D89483
llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
llvm/lib/Target/ARM/ARMBaseInstrInfo.h
llvm/test/CodeGen/ARM/machine-outliner-calls.mir
llvm/test/CodeGen/ARM/machine-outliner-cfi-1.ll [new file with mode: 0644]
llvm/test/CodeGen/ARM/machine-outliner-cfi-2.ll [new file with mode: 0644]
llvm/test/CodeGen/ARM/machine-outliner-cfi-3.ll [new file with mode: 0644]