aboutsummaryrefslogtreecommitdiffstats
path: root/test/Assembler
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2011-09-06 13:37:06 +0000
committerDuncan Sands <baldrick@free.fr>2011-09-06 13:37:06 +0000
commit4a544a79bd735967f1d33fe675ae4566dbd17813 (patch)
tree6e349c2fb6f02699e32acd33d232e8f448a6413c /test/Assembler
parentecd37bcd5ce27cacfa11c4731c46d9869278745e (diff)
downloadexternal_llvm-4a544a79bd735967f1d33fe675ae4566dbd17813.zip
external_llvm-4a544a79bd735967f1d33fe675ae4566dbd17813.tar.gz
external_llvm-4a544a79bd735967f1d33fe675ae4566dbd17813.tar.bz2
Split the init.trampoline intrinsic, which currently combines GCC's
init.trampoline and adjust.trampoline intrinsics, into two intrinsics like in GCC. While having one combined intrinsic is tempting, it is not natural because typically the trampoline initialization needs to be done in one function, and the result of adjust trampoline is needed in a different (nested) function. To get around this llvm-gcc hacks the nested function lowering code to insert an additional parent variable holding the adjust.trampoline result that can be accessed from the child function. Dragonegg doesn't have the luxury of tweaking GCC code, so it stored the result of adjust.trampoline in the memory GCC set aside for the trampoline itself (this is always available in the child function), and set up some new memory (using an alloca) to hold the trampoline. Unfortunately this breaks Go which allocates trampoline memory on the heap and wants to use it even after the parent has exited (!). Rather than doing even more hacks to get Go working, it seemed best to just use two intrinsics like in GCC. Patch mostly by Sanjoy Das. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139140 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Assembler')
-rw-r--r--test/Assembler/AutoUpgradeIntrinsics.ll13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Assembler/AutoUpgradeIntrinsics.ll b/test/Assembler/AutoUpgradeIntrinsics.ll
index eb4ac76..daffa3d 100644
--- a/test/Assembler/AutoUpgradeIntrinsics.ll
+++ b/test/Assembler/AutoUpgradeIntrinsics.ll
@@ -40,3 +40,16 @@ define void @p(i8* %ptr) {
tail call void @llvm.prefetch(i8* %ptr, i32 0, i32 1)
ret void
}
+
+declare i32 @nest_f(i8* nest, i32)
+declare i8* @llvm.init.trampoline(i8*, i8*, i8*)
+
+define void @test_trampolines() {
+; CHECK: call void @llvm.init.trampoline(i8* null, i8* bitcast (i32 (i8*, i32)* @nest_f to i8*), i8* null)
+; CHECK: call i8* @llvm.adjust.trampoline(i8* null)
+
+ call i8* @llvm.init.trampoline(i8* null,
+ i8* bitcast (i32 (i8*, i32)* @nest_f to i8*),
+ i8* null)
+ ret void
+}