diff options
author | David Majnemer <david.majnemer@gmail.com> | 2016-03-04 22:56:17 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2016-03-04 22:56:17 +0000 |
commit | d2f767d2f6832e5d6bf13ff7f3a309bcd2b8f502 (patch) | |
tree | 64f1583e8232461c32ab0557e66ffda8a39c4320 /llvm/lib/Target/X86/X86ISelLowering.cpp | |
parent | 5c3701c621cf480070de72bf244939b6440be33d (diff) | |
download | bcm5719-llvm-d2f767d2f6832e5d6bf13ff7f3a309bcd2b8f502.tar.gz bcm5719-llvm-d2f767d2f6832e5d6bf13ff7f3a309bcd2b8f502.zip |
[X86] Support cleaning more than 2**16 bytes of stack
The x86 ret instruction has a 16 bit immediate indicating how many bytes
to pop off of the stack beyond the return address.
There is a problem when extremely large structs are passed by value: we
might not be able to fit the number of bytes to pop into the return
instruction.
To fix this, expand RET_FLAG a little later and use a special sequence
to clean the stack:
pop %ecx ; return address is now in %ecx
add $n, %esp ; clean the stack
push %ecx ; bring the return address back on the stack
ret ; pop the return address and jmp to it's value
llvm-svn: 262755
Diffstat (limited to 'llvm/lib/Target/X86/X86ISelLowering.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 2a11eddaf15..65b8fb88b6d 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -2211,7 +2211,7 @@ X86TargetLowering::LowerReturn(SDValue Chain, RetOps.push_back(Chain); // Operand #0 = Chain (updated below) // Operand #1 = Bytes To Pop RetOps.push_back(DAG.getTargetConstant(FuncInfo->getBytesToPopOnReturn(), dl, - MVT::i16)); + MVT::i32)); // Copy the result values into the output registers. for (unsigned i = 0, e = RVLocs.size(); i != e; ++i) { |