forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AArch64] Implement INIT/ADJUST_TRAMPOLINE (llvm#70267)
Add support for llvm.init.trampoline and llvm.adjust.trampoline intrinsics for AArch64. Fixes llvm#65573 Fixes llvm#76927 Fixes llvm#83555 Updates llvm#66157 (cherry picked from commit c4b66bf)
- Loading branch information
Showing
6 changed files
with
127 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
; 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 | ||
} |