OSDN Git Service

ARM: fix bug in -Oz stack adjustment folding
authorTim Northover <tnorthover@apple.com>
Sun, 1 Dec 2013 14:16:24 +0000 (14:16 +0000)
committerTim Northover <tnorthover@apple.com>
Sun, 1 Dec 2013 14:16:24 +0000 (14:16 +0000)
commite54f6dca5074fe99d913ae1ce9bc43cf7a856b10
tree874fc05933cc4f5332e8cc92989524a7002933f3
parente1139818e835bbb3e7a5a377ee129d2ebb88a77d
ARM: fix bug in -Oz stack adjustment folding

Previously, we clobbered callee-saved registers when folding an "add
sp, #N" into a "pop {rD, ...}" instruction. This change checks whether
a register we're going to add to the "pop" could actually be live
outside the function before doing so and should fix the issue.

This should fix PR18081.

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