diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-05-09 20:10:38 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-05-09 20:10:38 +0000 |
commit | edfef3bd27d6269d473fbc570e8c2be02b4070df (patch) | |
tree | 0b90fc0efb67675975c7790b55e4278c290f2ddd /lib/Target/X86/X86FrameLowering.cpp | |
parent | 80d81aa8ba923c9f9a953410677ac53c4c2b8318 (diff) | |
download | external_llvm-edfef3bd27d6269d473fbc570e8c2be02b4070df.zip external_llvm-edfef3bd27d6269d473fbc570e8c2be02b4070df.tar.gz external_llvm-edfef3bd27d6269d473fbc570e8c2be02b4070df.tar.bz2 |
Generate a compact unwind encoding in the face of a stack alignment push.
We generate a `push' of a random register (%rax) if the stack needs to be
aligned by the size of that register. However, this could mess up compact unwind
generation. In particular, we want to still generate compact unwind in the
presence of this monstrosity.
Check if the push of of the %rax/%eax register. If it is and it's marked with
the `FrameSetup' flag, then we can generate a compact unwind encoding for the
function only if the push is the last FrameSetup instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181540 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86FrameLowering.cpp')
-rw-r--r-- | lib/Target/X86/X86FrameLowering.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Target/X86/X86FrameLowering.cpp b/lib/Target/X86/X86FrameLowering.cpp index ae51178..42b4e73 100644 --- a/lib/Target/X86/X86FrameLowering.cpp +++ b/lib/Target/X86/X86FrameLowering.cpp @@ -525,6 +525,12 @@ uint32_t X86FrameLowering::getCompactUnwindEncoding(MachineFunction &MF) const { // If there are too many saved registers, we cannot use compact encoding. if (SavedRegIdx >= CU_NUM_SAVED_REGS) return CU::UNWIND_MODE_DWARF; + unsigned Reg = MI.getOperand(0).getReg(); + if (Reg == (Is64Bit ? X86::RAX : X86::EAX)) { + ExpectEnd = true; + continue; + } + SavedRegs[SavedRegIdx++] = MI.getOperand(0).getReg(); StackAdjust += OffsetSize; InstrOffset += PushInstrSize; |