OSDN Git Service

ARM: fix handling of SUB immediates in peephole opt.
authorTim Northover <tnorthover@apple.com>
Mon, 2 May 2016 18:30:08 +0000 (18:30 +0000)
committerTim Northover <tnorthover@apple.com>
Mon, 2 May 2016 18:30:08 +0000 (18:30 +0000)
commit464549ab4d007645aebf62e498c7e3193af0f9d8
tree8f7d5c4dd997cbf4fff9317365a55798072bf8c4
parent2ab91e26c5885a3059503742df6b1c524db31a02
ARM: fix handling of SUB immediates in peephole opt.

We were negating an immediate that was going to be used in a SUBri form
unnecessarily. Since ADD/SUB are very similar we *can* do that, but we have to
change the SUB to an ADD at the same time. This also applies to ADD, and allows
us to handle a slightly larger range of immediates for those two operations.

rdar://25992245

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268276 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMBaseInstrInfo.cpp
test/CodeGen/MIR/ARM/imm-peephole-arm.mir [new file with mode: 0644]
test/CodeGen/MIR/ARM/imm-peephole-thumb.mir [new file with mode: 0644]