[PATCH] D125645: [ARM SEH 3] [ARM] [MC] Add support for writing ARM WinEH unwind info

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 20 12:43:36 PDT 2022


mstorsjo added a comment.

In D125645#3528320 <https://reviews.llvm.org/D125645#3528320>, @efriedma wrote:

> Did you consider instead of adding `.seh_endepilogue_nop`, just require writing `.seh_nop; .seh_endepilogue`?  Then we can automatically merge a tailing nop with the "end" opcode.

Hmm, I didn't consider that - as they're separate opcodes in the unwind info, I was kinda led into this format. But that sounds like a good idea - I'll try it out and see if it seems better or not!



================
Comment at: llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp:12113
+    if (Reg == 15) // pc -> lr
+      Reg = 14;
+    if (Reg == 13)
----------------
efriedma wrote:
> Do we really need the `pc -> lr` remapping, as opposed to just forbidding users from specifying `pc`?  Seems a little weird to have multiple ways to write the same unwind code.
I guess it's not strictly necessary, but both for consistency with the preceding instruction, you may want to use both; `pop {pc}` and `pop {lr}; bx lr` both would use the same `.seh_save_regs {lr}` opcode, while I think you'd might want to write `.seh_save_regs {pc}` in the former case.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125645



More information about the llvm-commits mailing list