It turns out most of the thumb2 instructions are not allowed to touch SP. The semanti...
authorEvan Cheng <evan.cheng@apple.com>
Fri, 7 Aug 2009 00:34:42 +0000 (00:34 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Fri, 7 Aug 2009 00:34:42 +0000 (00:34 +0000)
commit861986401e05e437cb33bfd8320d510b956fe41e
tree69ce77c93aa7b094dd2b99915d40c95b901df17a
parent3a3cce59c428619513b5209d62f9398b84743cdb
It turns out most of the thumb2 instructions are not allowed to touch SP. The semantics of such instructions are unpredictable. We have just been lucky that tests have been passing.

This patch takes pain to ensure all the PEI lowering code does the right thing when lowering frame indices, insert code to manipulate stack pointers, etc. It's also custom lowering dynamic stack alloc into pseudo instructions so we can insert the right instructions at scheduling time.

This fixes PR4659 and PR4682.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78361 91177308-0d34-0410-b5e6-96231b3b80d8
12 files changed:
lib/Target/ARM/ARMBaseInstrInfo.cpp
lib/Target/ARM/ARMBaseRegisterInfo.cpp
lib/Target/ARM/ARMISelDAGToDAG.cpp
lib/Target/ARM/ARMISelLowering.cpp
lib/Target/ARM/ARMISelLowering.h
lib/Target/ARM/ARMInstrThumb.td
lib/Target/ARM/ARMInstrThumb2.td
lib/Target/ARM/ARMLoadStoreOptimizer.cpp
lib/Target/ARM/README-Thumb2.txt
lib/Target/ARM/Thumb2InstrInfo.cpp
test/CodeGen/Thumb2/2009-08-06-SpDecBug.ll [new file with mode: 0644]
test/CodeGen/Thumb2/large-stack.ll