Split the init.trampoline intrinsic, which currently combines GCC's
authorDuncan Sands <baldrick@free.fr>
Tue, 6 Sep 2011 13:37:06 +0000 (13:37 +0000)
committerDuncan Sands <baldrick@free.fr>
Tue, 6 Sep 2011 13:37:06 +0000 (13:37 +0000)
commit4a544a79bd735967f1d33fe675ae4566dbd17813
tree6e349c2fb6f02699e32acd33d232e8f448a6413c
parentecd37bcd5ce27cacfa11c4731c46d9869278745e
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
19 files changed:
docs/LangRef.html
include/llvm/CodeGen/ISDOpcodes.h
include/llvm/Intrinsics.td
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
lib/Target/PowerPC/PPCISelLowering.cpp
lib/Target/PowerPC/PPCISelLowering.h
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86ISelLowering.h
lib/Target/XCore/XCoreISelLowering.cpp
lib/Target/XCore/XCoreISelLowering.h
lib/Transforms/InstCombine/InstCombine.h
lib/Transforms/InstCombine/InstCombineCalls.cpp
lib/VMCore/AutoUpgrade.cpp
test/Assembler/AutoUpgradeIntrinsics.ll
test/CodeGen/PowerPC/trampoline.ll
test/CodeGen/XCore/trampoline.ll
test/Transforms/InstCombine/2008-01-14-VarArgTrampoline.ll