[llvm-branch-commits] [llvm-branch] r181955 - Merging r181540:

Bill Wendling isanbard at gmail.com
Wed May 15 17:29:29 PDT 2013


Author: void
Date: Wed May 15 19:29:29 2013
New Revision: 181955

URL: http://llvm.org/viewvc/llvm-project?rev=181955&view=rev
Log:
Merging r181540:
------------------------------------------------------------------------
r181540 | void | 2013-05-09 13:10:38 -0700 (Thu, 09 May 2013) | 11 lines

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.

------------------------------------------------------------------------

Added:
    llvm/branches/release_33/test/CodeGen/X86/compact-unwind.ll
      - copied unchanged from r181540, llvm/trunk/test/CodeGen/X86/compact-unwind.ll
Modified:
    llvm/branches/release_33/   (props changed)
    llvm/branches/release_33/lib/Target/X86/X86FrameLowering.cpp

Propchange: llvm/branches/release_33/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed May 15 19:29:29 2013
@@ -1,3 +1,3 @@
 /llvm/branches/Apple/Pertwee:110850,110961
 /llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,181286,181296,181313,181397,181423,181450,181524,181576-181580,181586,181792,181800,181842
+/llvm/trunk:155241,181286,181296,181313,181397,181423,181450,181524,181540,181576-181580,181586,181792,181800,181842

Modified: llvm/branches/release_33/lib/Target/X86/X86FrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_33/lib/Target/X86/X86FrameLowering.cpp?rev=181955&r1=181954&r2=181955&view=diff
==============================================================================
--- llvm/branches/release_33/lib/Target/X86/X86FrameLowering.cpp (original)
+++ llvm/branches/release_33/lib/Target/X86/X86FrameLowering.cpp Wed May 15 19:29:29 2013
@@ -534,6 +534,12 @@ uint32_t X86FrameLowering::getCompactUnw
       // 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;





More information about the llvm-branch-commits mailing list