ARM/Dwarf: correctly align stack before callee-saved VPRs
authorTim Northover <tnorthover@apple.com>
Wed, 5 Nov 2014 00:27:13 +0000 (00:27 +0000)
committerTim Northover <tnorthover@apple.com>
Wed, 5 Nov 2014 00:27:13 +0000 (00:27 +0000)
commit1f771b80c0d80f0de36254d2481d1e7b6ae999a4
treea886e6164203eabbcbcf995ab4c372318266cca3
parent3839fd16a1a90de302e847109522379472108c30
ARM/Dwarf: correctly align stack before callee-saved VPRs

We were making an attempt to do this by adding an extra callee-saved GPR (so
that there was an even number in the list), but when that failed we went ahead
and pushed anyway.

This had a couple of potential issues:
  + The .cfi directives we emit misplaced dN because they were based on
    PrologEpilogInserter's calculation.
  + Unaligned stores can be less efficient.
  + Unaligned stores can actually fault (likely only an issue in niche cases,
    but possible).

This adds a final explicit stack adjustment if all other options fail, so that
the actual locations of the registers match up with where they should be.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221320 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMFrameLowering.cpp
lib/Target/ARM/ARMMachineFunctionInfo.h
test/CodeGen/ARM/dwarf-unwind.ll [new file with mode: 0644]