[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
Sun Nov 28 11:35:37 PST 2021


jrtc27 added inline comments.


================
Comment at: llvm/lib/CodeGen/CFIFixup.cpp:145
+      unsigned CFIIndex =
+          MF.addFrameInst(MCCFIInstruction::createRememberState(nullptr));
+      BuildMI(MBB, MBB.begin(), DebugLoc(),
----------------
Having both even in the case when you don't need it is a bit weird. You should be able to just keep track of the last MBB seen that had a frame and insert the remember at the end of it when you discover you need a restore in the current MBB. That also removes the need to special-case the prologue.

(This code is also confusing due to using MBB.begin() twice rather than an interator that gets advanced, as the insertion order ends up being backwards so the code looks the wrong way round at first glance)


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

https://reviews.llvm.org/D114545



More information about the llvm-commits mailing list