diff options
author | Reid Kleckner <reid@kleckner.net> | 2015-01-13 00:48:10 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2015-01-13 00:48:10 +0000 |
commit | e9b893187333ca069b5aed697ad784865e42f79f (patch) | |
tree | e17ad1b3279b4a6383370b0739b862f1b0635790 /llvm/lib/CodeGen/MachineFunction.cpp | |
parent | 845755c4bb6c55eca84700060de706331ba77a71 (diff) | |
download | llvm-e9b893187333ca069b5aed697ad784865e42f79f.zip llvm-e9b893187333ca069b5aed697ad784865e42f79f.tar.gz llvm-e9b893187333ca069b5aed697ad784865e42f79f.tar.bz2 |
Add the llvm.frameallocate and llvm.recoverframeallocation intrinsics
These intrinsics allow multiple functions to share a single stack
allocation from one function's call frame. The function with the
allocation may only perform one allocation, and it must be in the entry
block.
Functions accessing the allocation call llvm.recoverframeallocation with
the function whose frame they are accessing and a frame pointer from an
active call frame of that function.
These intrinsics are very difficult to inline correctly, so the
intention is that they be introduced rarely, or at least very late
during EH preparation.
Reviewers: echristo, andrew.w.kaylor
Differential Revision: http://reviews.llvm.org/D6493
llvm-svn: 225746
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineFunction.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index 8a2b610..6b4cba6 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -587,6 +587,14 @@ int MachineFrameInfo::CreateFixedSpillStackObject(uint64_t Size, return -++NumFixedObjects; } +int MachineFrameInfo::CreateFrameAllocation(uint64_t Size) { + // Force the use of a frame pointer. The intention is that this intrinsic be + // used in conjunction with unwind mechanisms that leak the frame pointer. + setFrameAddressIsTaken(true); + Size = RoundUpToAlignment(Size, StackAlignment); + return CreateStackObject(Size, StackAlignment, false); +} + BitVector MachineFrameInfo::getPristineRegs(const MachineBasicBlock *MBB) const { assert(MBB && "MBB must be valid"); |