[Thumb] Select (CMPZ X, -C) -> (CMPZ (ADDS X, C), 0)
commit5349cafffb46c7a71fa6c695cc8aab32e048b555
authorJames Molloy <james.molloy@arm.com>
Fri, 9 Sep 2016 12:52:24 +0000 (9 12:52 +0000)
committerJames Molloy <james.molloy@arm.com>
Fri, 9 Sep 2016 12:52:24 +0000 (9 12:52 +0000)
treefce4cb60e4d380c3df949ca48fb7da57b09955f1
parent3c6f3f0961d2722354ac4b3da3f00d14cf6aa92c
[Thumb] Select (CMPZ X, -C) -> (CMPZ (ADDS X, C), 0)

The CMPZ #0 disappears during peepholing, leaving just a tADDi3, tADDi8 or t2ADDri. This avoids having to materialize the expensive negative constant in Thumb-1, and allows a shrinking from a 32-bit CMN to a 16-bit ADDS in Thumb-2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281040 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMISelDAGToDAG.cpp
test/CodeGen/ARM/lsr-icmp-imm.ll
test/CodeGen/ARM/select_xform.ll
test/CodeGen/Thumb/cmp-add-fold.ll [new file with mode: 0644]
test/CodeGen/Thumb2/lsr-deficiency.ll
test/CodeGen/Thumb2/thumb2-cmn2.ll