[PATCH] D102477: X86: support Swift Async context

Tim Northover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 14 03:51:41 PDT 2021


t.p.northover created this revision.
t.p.northover added reviewers: jroelofs, paquette.
Herald added subscribers: lxfind, pengfei, hiraditya, kristof.beyls, mcrosier.
t.p.northover requested review of this revision.
Herald added a project: LLVM.

This adds support to the X86 backend for the newly committed `swiftasync` function parameter. If such a (pointer) parameter is present it gets stored into an augmented frame record (populated in IR, but generally containing enhanced backtrace for coroutines using lots of tail calls back and forth).

The context frame is identical to AArch64 (primarily so that unwinders etc don't get extra complexity). Specfically, the new frame record is `[AsyncCtx, %rbp, ReturnAddr]`, and its presence is signalled by bit 60 of the stored %rbp being set to 1. %rbp still points to the frame pointer in memory for backwards compatibility (only partial on x86, but OTOH the weird AsyncCtx before the rest of the record is because of x86).


https://reviews.llvm.org/D102477

Files:
  llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
  llvm/lib/Target/X86/X86CallingConv.td
  llvm/lib/Target/X86/X86FastISel.cpp
  llvm/lib/Target/X86/X86FrameLowering.cpp
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/lib/Target/X86/X86MachineFunctionInfo.h
  llvm/test/CodeGen/X86/swift-async-reg.ll
  llvm/test/CodeGen/X86/swift-async.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102477.345388.patch
Type: text/x-patch
Size: 16866 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210514/280be69e/attachment.bin>


More information about the llvm-commits mailing list