[llvm-commits] [llvm] r81879 - /llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp

Bob Wilson bob.wilson at apple.com
Tue Sep 15 10:56:18 PDT 2009


Author: bwilson
Date: Tue Sep 15 12:56:18 2009
New Revision: 81879

URL: http://llvm.org/viewvc/llvm-project?rev=81879&view=rev
Log:
Handle AddrMode4 for Thumb2 in rewriteT2FrameIndex.  This occurs for
VLDM/VSTM instructions, and without this check, the code assumes that an
offset is allowed, as it would be with VLDR/VSTR.  The asm printer,
however, silently drops the offset, producing incorrect code.  Since the
address register in this case is either the stack or frame pointer, the
spill location ends up conflicting with some other stack slot or with
outgoing arguments on the stack.

Modified:
    llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp

Modified: llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp?rev=81879&r1=81878&r2=81879&view=diff

==============================================================================
--- llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp Tue Sep 15 12:56:18 2009
@@ -383,6 +383,11 @@
            "Bit extraction didn't work?");
     MI.getOperand(FrameRegIdx+1).ChangeToImmediate(ThisImmVal);
   } else {
+
+    // AddrMode4 cannot handle any offset.
+    if (AddrMode == ARMII::AddrMode4)
+      return false;
+
     // AddrModeT2_so cannot handle any offset. If there is no offset
     // register then we change to an immediate version.
     unsigned NewOpc = Opcode;





More information about the llvm-commits mailing list