[all-commits] [llvm/llvm-project] 68d230: Recommit "Generate Callee Saved Register (CSR) rel...

wmi-11 via All-commits all-commits at lists.llvm.org
Mon Apr 27 12:47:55 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 68d2301e12351403edf57b6640294c35a09a80c5
      https://github.com/llvm/llvm-project/commit/68d2301e12351403edf57b6640294c35a09a80c5
  Author: Wei Mi <wmi at google.com>
  Date:   2020-04-27 (Mon, 27 Apr 2020)

  Changed paths:
    M llvm/lib/CodeGen/CFIInstrInserter.cpp
    M llvm/lib/Target/X86/X86FrameLowering.cpp
    M llvm/lib/Target/X86/X86FrameLowering.h
    A llvm/test/CodeGen/X86/cfi-epilogue-with-return.mir
    A llvm/test/CodeGen/X86/cfi-epilogue-without-return.mir
    A llvm/test/CodeGen/X86/cfi-inserter-callee-save-register-2.mir
    A llvm/test/CodeGen/X86/cfi-inserter-callee-save-register.mir
    A llvm/test/CodeGen/X86/cfi-inserter-verify-inconsistent-csr.mir
    A llvm/test/CodeGen/X86/cfi-inserter-verify-inconsistent-loc.mir

  Log Message:
  -----------
  Recommit "Generate Callee Saved Register (CSR) related cfi directives
like .cfi_restore"

Insert .cfi_offset/.cfi_register when IncomingCSRSaved of current block
is larger than OutgoingCSRSaved of its previous block.

Original commit message:
https://reviews.llvm.org/D42848 only handled CFA related cfi directives but
didn't handle CSR related cfi. The patch adds the CSR part. Basically it reuses
the framework created in D42848. For each basicblock, the patch tracks which
CSR set have been saved at its CFG predecessors's exits, and compare the CSR
set with the set at its previous basicblock's exit (The previous block is the
block laid before the current block). If the saved CSR set at its previous
basicblock's exit is larger, .cfi_restore will be inserted.

The patch also generates proper .cfi_restore in epilogue to make sure the
saved CSR set is consistent for the incoming edges of each block.

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




More information about the All-commits mailing list