]> granicus.if.org Git - llvm/commit
ARM: don't rely on push/pop reglists being in order when folding SP adjust.
authorTim Northover <tnorthover@apple.com>
Wed, 26 Oct 2016 20:01:00 +0000 (20:01 +0000)
committerTim Northover <tnorthover@apple.com>
Wed, 26 Oct 2016 20:01:00 +0000 (20:01 +0000)
commit1ff4f02fe695346b8d3ec9071d5bd4fd6eee6c18
tree162a968787425dc778937b019dfefd54b1a3b4ae
parent73235dc8dc50dd8fe358a560667049cd8f1edae5
ARM: don't rely on push/pop reglists being in order when folding SP adjust.

It would be a very nice invariant to rely on, but unfortunately it doesn't
necessarily hold (and the causes of mis-sorted reglists appear to be quite
varied) so to be robust the frame lowering code can't assume that the first
register in the list is also the first one that actually gets pushed.

Should fix an issue where we were turning something like:

    push {r8, r4, r7, lr}
    sub sp, #24

into nonsense like:

    push {r2, r3, r4, r5, r6, r7, r8, r4, r7, lr}

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285232 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMBaseInstrInfo.cpp
test/CodeGen/ARM/fold-stack-adjust.ll