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

Violeta Vukobrat via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 11 10:17:50 PDT 2016


violetav updated this revision to Diff 53270.
violetav added a comment.

Hi Michael,
Thank you for the review.
I addressed your comments in the patch and answered your questions inline.

I would like to explain why I went with this approach.
My first solution was to add the CFI instructions during emitEpilogue() in frame lowering. I realized that I would need to cover the cases when epilogue was in the middle of the function (when it was setting the wrong offset for blocks below it). The solution for that problem was to add a pass that would run after block placement and insert additional CFI instructions that correct the offset for BBs that have the wrong offset set by the epilogue above them (this is basically what the CorrectCFA method does now). However, then I found out another problem with inserting CFI instructions during emitEpilogue(): they interfered with later passes, e.g. the tail duplication pass wouldn't duplicate blocks that contained them. That is when I decided to move the insertion of CFI instructions in epilogue to the implemented pass.

What is it about this approach that you are not comfortable with? Do you have any suggestions on how it could be improved?


Repository:
  rL LLVM

http://reviews.llvm.org/D18046

Files:
  lib/Target/X86/CMakeLists.txt
  lib/Target/X86/X86.h
  lib/Target/X86/X86CFIInstrInserter.cpp
  lib/Target/X86/X86FrameLowering.cpp
  lib/Target/X86/X86TargetMachine.cpp
  test/CodeGen/X86/epilogue-cfi-fp.ll
  test/CodeGen/X86/epilogue-cfi-no-fp.ll
  test/CodeGen/X86/throws-cfi-fp.ll
  test/CodeGen/X86/throws-cfi-no-fp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18046.53270.patch
Type: text/x-patch
Size: 29050 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160411/b5a6fb46/attachment-0001.bin>


More information about the llvm-commits mailing list