ARMLoadStoreOptimizer: Rewrite LDM/STM matching logic.
authorMatthias Braun <matze@braunis.de>
Fri, 10 Jul 2015 18:08:49 +0000 (18:08 +0000)
committerMatthias Braun <matze@braunis.de>
Fri, 10 Jul 2015 18:08:49 +0000 (18:08 +0000)
commita4a3182dedbf53ffff977ddcd2ad95b91908f046
tree6583a32050f32d5dabed116f58d2c035a74d645f
parentbf91f712b384caafb12c5350491ff585ca8058ff
ARMLoadStoreOptimizer: Rewrite LDM/STM matching logic.

This improves the logic in several ways and is a preparation for
followup patches:
- First perform an analysis and create a list of merge candidates, then
  transform. This simplifies the code in that you have don't have to
  care to much anymore that you may be holding iterators to
  MachineInstrs that get removed.
- Analyze/Transform basic blocks in reverse order. This allows to use
  LivePhysRegs to find free registers instead of the RegisterScavenger.
  The RegisterScavenger will become less precise in the future as it
  relies on the deprecated kill-flags.
- Return the newly created node in MergeOps so there's no need to look
  around in the schedule to find it.
- Rename some MBBI iterators to InsertBefore to make their role clear.
- General code cleanup.

Differential Revision: http://reviews.llvm.org/D10140

llvm-svn: 241920
llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
llvm/test/CodeGen/ARM/2013-05-13-AAPCS-byval-padding2.ll