ARM: remove unnecessary state-tracking during frame lowering.
authorTim Northover <tnorthover@apple.com>
Mon, 4 Nov 2013 23:04:15 +0000 (23:04 +0000)
committerTim Northover <tnorthover@apple.com>
Mon, 4 Nov 2013 23:04:15 +0000 (23:04 +0000)
commite53abc20724ddde4e91467671328b531361a734f
treebe0cc984bc4b0392f260a06ec1dc96b9c3edc50a
parent627ef0cf5e3d1989eadab38e491268847b32869f
ARM: remove unnecessary state-tracking during frame lowering.

ResolveFrameIndex had what appeared to be a very nasty hack for when the
frame-index referred to a callee-saved register. In this case it "adjusted" the
offset so that the address was correct if (and only if) the MachineInstr
immediately followed the respective push.

This "worked" for all forms of GPR & DPR but was only ever used to set the
frame pointer itself, and once this was put in a more sensible location the
entire state-tracking machinery it relied on became redundant. So I stripped
it.

The only wrinkle is that "add r7, sp, #0" might theoretically be slower (need
an actual ALU slot) compared to "mov r7, sp" so I added a micro-optimisation
that also makes emitARMRegUpdate and emitT2RegUpdate also work when NumBytes ==
0.

No test changes since there shouldn't be any functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194025 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMBaseInstrInfo.cpp
lib/Target/ARM/ARMFrameLowering.cpp
lib/Target/ARM/ARMMachineFunctionInfo.h
lib/Target/ARM/Thumb1FrameLowering.cpp
lib/Target/ARM/Thumb1RegisterInfo.cpp
lib/Target/ARM/Thumb2InstrInfo.cpp