[all-commits] [llvm/llvm-project] d0c973: [llvm][clang] Allocate a new stack instead of spaw...

Michael Spencer via All-commits all-commits at lists.llvm.org
Tue Apr 15 11:19:28 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d0c973a7a0149db3b71767d4c5a20a31e6a8ed5b
      https://github.com/llvm/llvm-project/commit/d0c973a7a0149db3b71767d4c5a20a31e6a8ed5b
  Author: Michael Spencer <bigcheesegs at gmail.com>
  Date:   2025-04-15 (Tue, 15 Apr 2025)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Basic/Stack.h
    M clang/lib/Basic/Stack.cpp
    M clang/lib/Frontend/CompilerInstance.cpp
    M llvm/include/llvm/Support/CrashRecoveryContext.h
    A llvm/include/llvm/Support/ProgramStack.h
    M llvm/lib/Support/CMakeLists.txt
    M llvm/lib/Support/CrashRecoveryContext.cpp
    A llvm/lib/Support/ProgramStack.cpp
    M llvm/unittests/Support/CMakeLists.txt
    A llvm/unittests/Support/ProgramStackTest.cpp

  Log Message:
  -----------
  [llvm][clang] Allocate a new stack instead of spawning a new thread to get more stack space (#133173)

Clang spawns a new thread to avoid running out of stack space. This can
make debugging and performance analysis more difficult as how the
threads are connected is difficult to recover.

This patch introduces `runOnNewStack` and applies it in Clang. On
platforms that have good support for it this allocates a new stack and
moves to it using assembly. Doing split stacks like this actually runs
on most platforms, but many debuggers and unwinders reject the large or
backwards stack offsets that occur. Apple platforms and tools are known
to support this, so this only enables it there for now.



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