[all-commits] [llvm/llvm-project] ac6878: [X86] Set frame-setup/frame-destroy on prologue/ep...

Fangrui Song via All-commits all-commits at lists.llvm.org
Thu Mar 31 23:05:03 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ac6878b330f3dfb4a7e99093dfdd9d88bacead28
      https://github.com/llvm/llvm-project/commit/ac6878b330f3dfb4a7e99093dfdd9d88bacead28
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-03-31 (Thu, 31 Mar 2022)

  Changed paths:
    M llvm/lib/Target/X86/X86FrameLowering.cpp
    M llvm/lib/Target/X86/X86FrameLowering.h
    M llvm/test/CodeGen/X86/cfi-xmm.ll
    M llvm/test/CodeGen/X86/epilogue-cfi-fp.ll
    M llvm/test/CodeGen/X86/push-cfi.ll
    M llvm/test/CodeGen/X86/throws-cfi-fp.ll

  Log Message:
  -----------
  [X86] Set frame-setup/frame-destroy on prologue/epilogue CFI instructions

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 locate all CFI instructions in the prologue, which can be handy to use
.cfi_remember_state/.cfi_restore_state to decrease unwind table size (D114545).

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D122541




More information about the All-commits mailing list