Add support for llvm.init.trampoline and llvm.adjust.trampoline intrinsics for AArch64. Fixes https://github.com/llvm/llvm-project/issues/65573 Fixes https://github.com/llvm/llvm-project/issues/76927 Fixes https://github.com/llvm/llvm-project/issues/83555 Updates https://github.com/llvm/llvm-project/pull/66157
20 lines
509 B
LLVM
20 lines
509 B
LLVM
; RUN: llc -mtriple=aarch64-- < %s | FileCheck %s
|
|
|
|
declare void @llvm.init.trampoline(ptr, ptr, ptr);
|
|
declare ptr @llvm.adjust.trampoline(ptr);
|
|
|
|
define i64 @f(ptr nest %c, i64 %x, i64 %y) {
|
|
%sum = add i64 %x, %y
|
|
ret i64 %sum
|
|
}
|
|
|
|
define i64 @main() {
|
|
%val = alloca i64
|
|
%nval = bitcast ptr %val to ptr
|
|
%tramp = alloca [36 x i8], align 8
|
|
; CHECK: bl __trampoline_setup
|
|
call void @llvm.init.trampoline(ptr %tramp, ptr @f, ptr %nval)
|
|
%fp = call ptr @llvm.adjust.trampoline(ptr %tramp)
|
|
ret i64 0
|
|
}
|