1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00
llvm-mirror/test/CodeGen/X86/swift-async-reg.ll
Tim Northover e0f9fc91a2 Recommit X86: support Swift Async context
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).

Recommited with a fix for unwind info when i386 pc-rel thunks are
adjacent to a prologue.
2021-05-18 15:19:05 +01:00

18 lines
379 B
LLVM

; RUN: llc -mtriple=x86_64-apple-darwin %s -o - | FileCheck %s
; RUN: llc -mtriple=x86_64-apple-darwin %s -o - -fast-isel | FileCheck %s
define i8* @argument(i8* swiftasync %in) {
; CHECK-LABEL: argument:
; CHECK: movq %r14, %rax
ret i8* %in
}
define void @call(i8* %in) {
; CHECK-LABEL: call:
; CHECK: movq %rdi, %r14
call i8* @argument(i8* swiftasync %in)
ret void
}