[all-commits] [llvm/llvm-project] df75b5: [win][x64] Add support for Windows x64 unwind v3 (...

Daniel Paoliello via All-commits all-commits at lists.llvm.org
Tue Jun 9 12:03:23 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: df75b5d458b9faef2007485e8348d83b32798a5c
      https://github.com/llvm/llvm-project/commit/df75b5d458b9faef2007485e8348d83b32798a5c
  Author: Daniel Paoliello <danpao at microsoft.com>
  Date:   2026-06-09 (Tue, 09 Jun 2026)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Basic/CodeGenOptions.def
    M clang/include/clang/Basic/CodeGenOptions.h
    M clang/include/clang/Options/Options.td
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/test/CodeGen/epilog-unwind.c
    A clang/test/CodeGen/winx64-eh-unwind-egpr.c
    M clang/test/Driver/cl-options.c
    A clang/test/Driver/winx64-eh-unwind.c
    M llvm/docs/ReleaseNotes.md
    M llvm/include/llvm/IR/Module.h
    M llvm/include/llvm/MC/MCStreamer.h
    M llvm/include/llvm/MC/MCWin64EH.h
    M llvm/include/llvm/MC/MCWinEH.h
    M llvm/include/llvm/Support/CodeGen.h
    M llvm/lib/IR/Module.cpp
    M llvm/lib/MC/MCAsmStreamer.cpp
    M llvm/lib/MC/MCStreamer.cpp
    M llvm/lib/MC/MCWin64EH.cpp
    M llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
    M llvm/lib/Target/X86/CMakeLists.txt
    M llvm/lib/Target/X86/X86.h
    M llvm/lib/Target/X86/X86AsmPrinter.cpp
    M llvm/lib/Target/X86/X86FrameLowering.cpp
    M llvm/lib/Target/X86/X86InstrCompiler.td
    M llvm/lib/Target/X86/X86MCInstLower.cpp
    M llvm/lib/Target/X86/X86TargetMachine.cpp
    M llvm/lib/Target/X86/X86WinEHUnwindV2.cpp
    A llvm/lib/Target/X86/X86WinEHUnwindV3.cpp
    A llvm/test/CodeGen/X86/apx/push2-pop2-cfi-seh-v3.ll
    M llvm/test/CodeGen/X86/apx/push2-pop2-cfi-seh.ll
    A llvm/test/CodeGen/X86/win64-eh-unwindv3-egpr-required.ll
    A llvm/test/CodeGen/X86/win64-eh-unwindv3-funclet-prolog.ll
    A llvm/test/CodeGen/X86/win64-eh-unwindv3-push2pop2.ll
    A llvm/test/CodeGen/X86/win64-eh-unwindv3-split.ll
    A llvm/test/CodeGen/X86/win64-eh-unwindv3-too-many-epilog-ops.mir
    A llvm/test/CodeGen/X86/win64-eh-unwindv3-too-many-prolog-ops.mir
    A llvm/test/CodeGen/X86/win64-eh-unwindv3.ll
    M llvm/test/DebugInfo/COFF/apx-egpr.ll
    M llvm/test/MC/AsmParser/seh-directive-errors.s
    A llvm/test/MC/COFF/seh-unwindv3-error.s
    A llvm/test/MC/COFF/seh-unwindv3-inheritance.s
    A llvm/test/MC/COFF/seh-unwindv3-large.s
    A llvm/test/MC/COFF/seh-unwindv3-nonmirror.s
    A llvm/test/MC/COFF/seh-unwindv3-pool-sharing.s
    A llvm/test/MC/COFF/seh-unwindv3.s
    M llvm/unittests/MC/CMakeLists.txt
    A llvm/unittests/MC/WODRoundTripTest.cpp

  Log Message:
  -----------
  [win][x64] Add support for Windows x64 unwind v3 (#200249)

The extended registers in Intel APX cannot be described in the current
Windows x64 unwind information, this has made it neccesary to introduce
a new version. While designing this new version, improvements have been
made from the lessons learnt from the existing unwind information
formats (both x64 and AArch64).

Documentation for unwind v3 is available at:
<https://learn.microsoft.com/en-us/cpp/build/x64-unwind-information-v3>

This change:
* Implements encoding unwind v3 information in MC. This includes support
for non-mirror epilogs, WOD pool sharing and using large infos if
required.
* Add support for encoding push2/pop2 SEH info: a new `SEH_Push2Regs`
pseudo-instruction and `.seh_push2regs` assembly directive.
* Changes the prolog/epilog codegen to support unwind v3. Specifically,
adding pseudos into the epilog (as non-mirror epilogs are permitted) and
placing the pseudos in the prolog before the instruction instead of
after (as v3 measures its offsets from the start rather than the end of
an instruction).
* Add an unwind v3 pass to chain unwind info if there are too many
epilogs in a function and raise a fatal error if there are too many
instructions in a prolog or epilog.
* Changes the module flag and code gen enums to allow selecting
"Default" vs "v1" vs "v2 best effort" vs "v2 required" vs "v3" unwind
info version.
* Adds new Clang and cc1 flags for selecting the unwind info version and
deprecates the old v2 flag. The default unwind info version stays as v1
UNLESS the EGPR target feature is enabled (then it will use v3). Trying
to enable EGPR when v1/v2 is explicitly enabled will result in an error.

Windows 11 [build
29576](https://learn.microsoft.com/en-us/windows-insider/release-notes/experimental-future-platforms/preview-build-29576-1000)
and above support unwind v3 in user-mode, but do not yet support large
info.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list