This is an archive of the discontinued LLVM Phabricator instance.

[ARM][MachineOutliner] Emit more CFI instructions
ClosedPublic

Authored by chill on Oct 15 2020, 10:02 AM.

Details

Summary

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.

Diff Detail

Event Timeline

chill created this revision.Oct 15 2020, 10:02 AM
chill requested review of this revision.Oct 15 2020, 10:02 AM
chill planned changes to this revision.Oct 16 2020, 4:26 AM
chill added inline comments.
llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
6150

Need to fix the sign here and elsewhere ...

chill updated this revision to Diff 298835.Oct 17 2020, 9:48 AM
danielkiss added inline comments.Nov 5 2020, 3:00 PM
llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
6196

I would generate a .cfi_restore lr here for the first sight.
The LR in the caller is saved on the stack probably so here the value of the LR is different because that is set by the bl.

chill planned changes to this revision.Nov 6 2020, 3:12 AM
chill added inline comments.
llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
6196

Thanks, yes, that's right, "same value" is wrong here.

chill updated this revision to Diff 303627.Nov 7 2020, 2:21 AM
chill marked an inline comment as done.
yroux accepted this revision.Nov 9 2020, 1:01 AM

Just a small comment, otherwise LGTM, thanks

llvm/lib/Target/ARM/ARMBaseInstrInfo.h
393

looks like a typo

This revision is now accepted and ready to land.Nov 9 2020, 1:01 AM
chill updated this revision to Diff 303771.Nov 9 2020, 1:23 AM
chill marked an inline comment as done.

Thanks!

This revision was automatically updated to reflect the committed changes.