[PATCH] D130049: [WinSEH][ARM64] Split unwind info for functions larger than 1MB

Z. Zheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 18 16:03:59 PDT 2022


zzheng created this revision.
zzheng added reviewers: efriedma, apazos, mstorsjo.
Herald added subscribers: rupprecht, hiraditya, kristof.beyls.
Herald added a reviewer: jhenderson.
Herald added a project: All.
zzheng requested review of this revision.
Herald added subscribers: llvm-commits, MaskRay.
Herald added a project: LLVM.

Create function segments and emit unwind info of them.

A segment must be less than 1MB and no prolog or epilog can cross segments boundary.

Reference: https://docs.microsoft.com/en-us/cpp/build/arm64-exception-handling#function-fragments

TODOs:

1. Enable packed unwind info (.pdata only) for multi-segment functions. (currently only enabled for functions less than 1MB, that is: functions have one segment)
2. Emit packed unwind info (.pdata only) for segments that have neithor prolog nor epilog.

These two will be done in next patch (WIP).

3. Handle functions that requires more than 256 (0xFF) bytes to encode all prolog and epilogs unwind op.

This one needs some change as we need to move counting code words for epilog earlier in the current process.

4. Shrink Wrapping where some stack ops are moved out of prolog/epilog and put in different segment. See example 2 of above link.
5. Align directive or aligning loops where we cannot reliably compute function size.

4 and 5 are kind of future work, I'm think about what to do as well as getting test cases for them.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130049

Files:
  llvm/include/llvm/MC/MCWinEH.h
  llvm/lib/MC/MCWin64EH.cpp
  llvm/test/MC/AArch64/seh-large-func.s
  llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130049.445644.patch
Type: text/x-patch
Size: 32974 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220718/f17d0123/attachment-0001.bin>


More information about the llvm-commits mailing list