Load / store multiple was missing opportunites when the load / store bundles are...
[oota-llvm.git] / lib / Target / ARM / ARMLoadStoreOptimizer.cpp
index d2ec9ee6cdf9736d67008f1cf2272a1d5a3a0769..c9b9e84c2a3b68460608ec8cde472b3dfe15773d 100644 (file)
@@ -974,6 +974,9 @@ bool ARMLoadStoreOpt::LoadStoreMultipleOpti(MachineBasicBlock &MBB) {
     if (Advance) {
       ++Position;
       ++MBBI;
+      if (MBBI == E)
+        // Reach the end of the block, try merging the memory instructions.
+        TryMerge = true;
     } else
       TryMerge = true;