[X86] Fix emitEpilogue() to make less assumptions about pops
authorMichael Kuperstein <michael.m.kuperstein@intel.com>
Wed, 16 Sep 2015 11:18:25 +0000 (11:18 +0000)
committerMichael Kuperstein <michael.m.kuperstein@intel.com>
Wed, 16 Sep 2015 11:18:25 +0000 (11:18 +0000)
commitb82c32333bd85e18a0992044c33295130dccd178
tree19ee5657ee01c8d54aca9f58aee784093199ac2d
parentde9de11b234a268f3953266e6256ca519ee99aa4
[X86] Fix emitEpilogue() to make less assumptions about pops

This is the mirror image of r242395.
When X86FrameLowering::emitEpilogue() looks for where to insert the %esp addition that
deallocates stack space used for local allocations, it assumes that any sequence of pop
instructions from function exit backwards consists purely of restoring callee-save registers.

This may be false, since from some point backward, the pops may be clean-up of stack space
allocated for arguments to a call.

Patch by: amjad.aboud@intel.com
Differential Revision: http://reviews.llvm.org/D12688

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247784 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/MachineInstr.h
lib/CodeGen/MachineInstr.cpp
lib/Target/X86/X86FrameLowering.cpp