This is an archive of the discontinued LLVM Phabricator instance.

[X86] Set frame-setup/frame-destroy on prologue/epilogue CFI instructions
ClosedPublic

Authored by MaskRay on Mar 27 2022, 12:38 AM.

Details

Summary

This approach is used by AArch64/RISCV to make frame-setup/frame-destroy
instructions contiguous instead of being interleaved by CFI instructions. Code
checking MBBI->getFlag(MachineInstr::FrameSetup) || MBBI->isCFIInstruction()
can be simplified to just check FrameSetup.

This helps get all CFI instructions in the prologue, which can be handy to use
.cfi_remember_state/.cfi_restore_state to decrease unwind table size.

Diff Detail

Event Timeline

MaskRay created this revision.Mar 27 2022, 12:38 AM
MaskRay requested review of this revision.Mar 27 2022, 12:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 27 2022, 12:38 AM
MaskRay edited the summary of this revision. (Show Details)Mar 27 2022, 12:39 AM

pre-commit the tests?

llvm/test/CodeGen/X86/cfi-xmm.ll
31

Include the ret line?

; PEI-NEXT:    RET 0
MaskRay updated this revision to Diff 419175.Mar 30 2022, 9:05 AM
MaskRay marked an inline comment as done.

rebase

RKSimon accepted this revision.Mar 31 2022, 1:45 AM

LGTM

This revision is now accepted and ready to land.Mar 31 2022, 1:45 AM
MaskRay edited the summary of this revision. (Show Details)Mar 31 2022, 10:40 PM
MaskRay edited the summary of this revision. (Show Details)Mar 31 2022, 10:42 PM
This revision was landed with ongoing or failed builds.Mar 31 2022, 11:05 PM
This revision was automatically updated to reflect the committed changes.