summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2016-01-21 22:23:22 +0000
committerReid Kleckner <rnk@google.com>2016-01-21 22:23:22 +0000
commit18ec96f0fcf4bfc312518bd0d5fda98f795c7a09 (patch)
treee3c5b161a3d5b1b282c5566c3d244dca7ef608c4 /llvm/lib/CodeGen
parentbfc33d0f3a786682ec7672f955fbbec80a7bd341 (diff)
downloadbcm5719-llvm-18ec96f0fcf4bfc312518bd0d5fda98f795c7a09.tar.gz
bcm5719-llvm-18ec96f0fcf4bfc312518bd0d5fda98f795c7a09.zip
Avoid unnecessary stack realignment in musttail thunks with SSE2 enabled
The X86 musttail implementation finds register parameters to forward by running the calling convention algorithm until a non-register location is returned. However, assigning a vector memory location has the side effect of increasing the function's stack alignment. We shouldn't increase the stack alignment when we are only looking for register parameters, so this change conditionalizes it. llvm-svn: 258442
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/CallingConvLower.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/CallingConvLower.cpp b/llvm/lib/CodeGen/CallingConvLower.cpp
index bdd5b5552c0..2a8a9e793ab 100644
--- a/llvm/lib/CodeGen/CallingConvLower.cpp
+++ b/llvm/lib/CodeGen/CallingConvLower.cpp
@@ -51,7 +51,7 @@ void CCState::HandleByVal(unsigned ValNo, MVT ValVT,
Size = MinSize;
if (MinAlign > (int)Align)
Align = MinAlign;
- MF.getFrameInfo()->ensureMaxAlignment(Align);
+ ensureMaxAlignment(Align);
MF.getSubtarget().getTargetLowering()->HandleByVal(this, Size, Align);
Size = unsigned(alignTo(Size, MinAlign));
unsigned Offset = AllocateStack(Size, Align);
@@ -236,6 +236,7 @@ void CCState::analyzeMustTailForwardedRegisters(
// variadic functions, so we need to assume we're not variadic so that we get
// all the registers that might be used in a non-variadic call.
SaveAndRestore<bool> SavedVarArg(IsVarArg, false);
+ SaveAndRestore<bool> SavedMustTail(AnalyzingMustTailForwardedRegs, true);
for (MVT RegVT : RegParmTypes) {
SmallVector<MCPhysReg, 8> RemainingRegs;
OpenPOWER on IntegriCloud