summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/StackMaps.cpp
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2014-08-01 18:26:27 +0000
committerPhilip Reames <listmail@philipreames.com>2014-08-01 18:26:27 +0000
commit87c2b605f5862edeeaa3f5b2f1674e3071e8e99c (patch)
tree0c155b2e611952f1fc54e9e9512199b3fd49a1dd /llvm/lib/CodeGen/StackMaps.cpp
parentce47a05c7c5251fa8d0e4e6d9610b774d53a5e7c (diff)
downloadbcm5719-llvm-87c2b605f5862edeeaa3f5b2f1674e3071e8e99c.tar.gz
bcm5719-llvm-87c2b605f5862edeeaa3f5b2f1674e3071e8e99c.zip
Explicitly report runtime stack realignment in StackMap section
This change adds code to explicitly mark a function which requires runtime stack realignment as not having a fixed frame size in the StackMap section. As it happens, this is not actually a functional change. The size that would be reported without the check is also "-1", but as far as I can tell, that's an accident. The code change makes this explicit. Note: There's a separate bug in handling of stackmaps and patchpoints in functions which need dynamic frame realignment. The current code assumes that offsets can be calculated from RBP, but realigned frames must use RSP. (There's a variable gap between RBP and the spill slots.) This change set does not address that issue. Reviewers: atrick, ributzka Differential Revision: http://reviews.llvm.org/D4572 llvm-svn: 214534
Diffstat (limited to 'llvm/lib/CodeGen/StackMaps.cpp')
-rw-r--r--llvm/lib/CodeGen/StackMaps.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/StackMaps.cpp b/llvm/lib/CodeGen/StackMaps.cpp
index 1473fc184f8..6c7547fe2b2 100644
--- a/llvm/lib/CodeGen/StackMaps.cpp
+++ b/llvm/lib/CodeGen/StackMaps.cpp
@@ -236,8 +236,11 @@ void StackMaps::recordStackMapOpers(const MachineInstr &MI, uint64_t ID,
// Record the stack size of the current function.
const MachineFrameInfo *MFI = AP.MF->getFrameInfo();
+ const TargetRegisterInfo *RegInfo = AP.MF->getTarget().getRegisterInfo();
+ const bool DynamicFrameSize = MFI->hasVarSizedObjects() ||
+ RegInfo->needsStackRealignment(*(AP.MF));
FnStackSize[AP.CurrentFnSym] =
- MFI->hasVarSizedObjects() ? UINT64_MAX : MFI->getStackSize();
+ DynamicFrameSize ? UINT64_MAX : MFI->getStackSize();
}
void StackMaps::recordStackMap(const MachineInstr &MI) {
OpenPOWER on IntegriCloud