[PATCH] D18046: [X86] Providing correct unwind info in function epilogue

Keno Fischer via llvm-commits llvm-commits at lists.llvm.org
Thu May 12 14:30:20 PDT 2016


loladiro added a comment.

My thinking was the following: There's generally three phases to CFI:

- Setting up everything (prologue)
- The function body
- (Potentially multiple epilogues)

On entry to most basic blocks, the current state of the CFI program will be that which we established after the prologue.
The idea is basically to, in the early passes have the invariant that no basic block other than the prologue changes the CFI
state (i.e. the state at the beginning of the basic block must be the same as the state at the end of the basic block). I think such an invariant
could be easily maintained in all the pre-layout passes (worst case by just inserting remember/restore pairs). I think in
most situations this will actually be already correct (since the only places inside the function where the CFI state changes is the epilogue).
The job of the late pass would then simply be to clean everything up once the layout is known (e.g. removing redundant remember/restore pairs, coalescing multiple instructions etc.


Repository:
  rL LLVM

http://reviews.llvm.org/D18046





More information about the llvm-commits mailing list