[Thumb] Select (CMPZ X, -C) -> (CMPZ (ADDS X, C), 0)
authorJames Molloy <james.molloy@arm.com>
Fri, 9 Sep 2016 12:52:24 +0000 (12:52 +0000)
committerJames Molloy <james.molloy@arm.com>
Fri, 9 Sep 2016 12:52:24 +0000 (12:52 +0000)
commit4d86bed0bb2d109f9aa802cc09377900b84c09bb
tree19d55765b086baec9f875b689c46d4006c30bd9a
parenta6987a4dddc61168fbccba7493c176d35689a004
[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.

llvm-svn: 281040
llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
llvm/test/CodeGen/ARM/lsr-icmp-imm.ll
llvm/test/CodeGen/ARM/select_xform.ll
llvm/test/CodeGen/Thumb/cmp-add-fold.ll [new file with mode: 0644]
llvm/test/CodeGen/Thumb2/lsr-deficiency.ll
llvm/test/CodeGen/Thumb2/thumb2-cmn2.ll