[all-commits] [llvm/llvm-project] 2488f2: [win][x64] Unwind v2 3/n: Add support for requirin...

Daniel Paoliello via All-commits all-commits at lists.llvm.org
Mon Jun 16 15:07:02 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2488f26d15e7e12aef9ead3fcb2d1b6da51812fb
      https://github.com/llvm/llvm-project/commit/2488f26d15e7e12aef9ead3fcb2d1b6da51812fb
  Author: Daniel Paoliello <danpao at microsoft.com>
  Date:   2025-06-16 (Mon, 16 Jun 2025)

  Changed paths:
    M clang/include/clang/Basic/CodeGenOptions.def
    M clang/include/clang/Driver/Options.td
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/test/CodeGen/epilog-unwind.c
    M clang/test/Driver/cl-options.c
    M llvm/include/llvm/IR/Module.h
    M llvm/include/llvm/Support/CodeGen.h
    M llvm/lib/IR/Module.cpp
    M llvm/lib/Target/X86/X86WinEHUnwindV2.cpp
    A llvm/test/CodeGen/X86/win64-eh-unwindv2-errors.mir
    A llvm/test/CodeGen/X86/win64-eh-unwindv2-too-many-epilogs.mir

  Log Message:
  -----------
  [win][x64] Unwind v2 3/n: Add support for requiring unwind v2 to be used (equivalent to MSVC's /d2epilogunwindrequirev2) (#143577)

#129142 added support for emitting Windows x64 unwind v2 information,
but it was "best effort". If any function didn't follow the requirements
for v2 it was silently downgraded to v1.

There are some parts of Windows (specifically kernel-mode code running
on Xbox) that require v2, hence we need the ability to fail the
compilation if v2 can't be used.

This change also adds a heuristic to check if there might be too many
unwind codes, it's currently conservative (i.e., assumes that certain
prolog instructions will use the maximum number of unwind codes).

Future work: attempting to chain unwind info across multiple tables if
there are too many unwind codes due to epilogs and adding a heuristic to
detect if an epilog will be too far from the end of the function.



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