Fix handling of negative offsets for AddrModeT2_i8s4 in rewriteT2FrameIndex.
authorBob Wilson <bob.wilson@apple.com>
Tue, 24 Feb 2015 01:37:31 +0000 (01:37 +0000)
committerBob Wilson <bob.wilson@apple.com>
Tue, 24 Feb 2015 01:37:31 +0000 (01:37 +0000)
commit8e29dec98657764a907746694a3b835860828f2c
tree468faac225eebb84791e4a222b740d63bf9844bd
parente977e51d71d02e9702fc206a1456bd13ef44dd21
Fix handling of negative offsets for AddrModeT2_i8s4 in rewriteT2FrameIndex.

This is a follow up to r230233 to fix something that I noticed by
inspection. The AddrModeT2_i8s4 addressing mode does not support
negative offsets. I spent a good chunk of the day trying to come up with
a testcase for this but was not successful. This addressing mode is used
to spill and restore GPRPair registers in Thumb2 code and that does not
happen often. We also make very limited used of negative offsets when
lowering frame indexes. I am going ahead with the change anyway, because
I am pretty confident that it is correct. I also added a missing assertion
to check that the low bits of the scaled offset are zero.

llvm-svn: 230297
llvm/lib/Target/ARM/Thumb2InstrInfo.cpp