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

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 28 16:09:51 PDT 2016


rnk added a comment.

In http://reviews.llvm.org/D18046#381033, @mkuper wrote:

> Reid, I think you originally supported this on the mailing list. Can you please take a look and see whether this is what you had in mind?


Apparently I did say that. This pass ended up being surprisingly complicated, I thought it would be a lot simpler. =/

I guess I think we do need a late pass, but it should coordinate with X86FrameLowering so that it doesn't have to reason too much about arbitrary X86 code. We shouldn't have to try to pattern match instructions that reset ESP from EBP, for example. We shouldn't need to run a dataflow algorithm to calculate the CFA on exit-entry to MBB. X86FrameLowering should *know* this information, and should write it down in some side table that we can refer to in this late pass.

Does that make sense? The late pass should only exist to handle the special case of machine block placement creating mid-function return blocks. The majority of the CFA logic should be in the prologue/epilogue generation.


Repository:
  rL LLVM

http://reviews.llvm.org/D18046





More information about the llvm-commits mailing list