[PATCH] D114545: [CodeGen] Async unwind - add a pass to fix CFI information

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 8 07:04:20 PST 2021


jrtc27 added inline comments.


================
Comment at: llvm/lib/CodeGen/CFIFixup.cpp:190
+      ++InsertPt;
+      InsertMBB = &*CurrBB;
+      Change = true;
----------------
jrtc27 wrote:
> Ok but doing that here doesn't make sense, now you restore back to the prologue but other things may have happened? I was imagining updating the last MBB with a frame whenever Info.HasFrameOnExit. Then you also don't need InsertPt, just insert at the end of the that MBB. That'll keep the remember/restore tight around just the MBBs that clobber the CFI state.
Although that doesn't work when you have multiple epilogues next to each other. You can instead keep InsertPt lying around, and updated it to CurrBB->end() whenever HasFrameOnExit is true, and in this case here set it to what you currently do just in case you don't see a non-epilogue frame before the next restore is needed.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114545/new/

https://reviews.llvm.org/D114545



More information about the llvm-commits mailing list