Add ARM heuristic for when to allocate a virtual base register for stack
access. rdar://8277890&7352504

llvm-svn: 111968
diff --git a/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp b/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp
index 3f79593..8bb802f 100644
--- a/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp
+++ b/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp
@@ -250,7 +250,7 @@
             continue;
 
           DEBUG(dbgs() << "Considering: " << *MI);
-          if (TRI->needsFrameBaseReg(MI, i)) {
+          if (TRI->needsFrameBaseReg(MI, LocalOffsets[FrameIdx])) {
             unsigned BaseReg = 0;
             int64_t Offset = 0;
             int64_t FrameSizeAdjust = StackGrowsDown ? MFI->getLocalFrameSize()