[AArch64] Rewrite (add, csel) to cinc
authorSjoerd Meijer <sjoerd.meijer@arm.com>
Tue, 16 Mar 2021 11:53:43 +0000 (11:53 +0000)
committerSjoerd Meijer <sjoerd.meijer@arm.com>
Thu, 18 Mar 2021 08:49:27 +0000 (08:49 +0000)
commit90ecb862a003d581136842dcdc213315727d50e2
tree58a06cfe33492e5694008364138f6f3044eda251
parent3d0aed79362de001bf010ae027f099a177ed19ed
[AArch64] Rewrite (add, csel) to cinc

Don't rewrite an add instruction with 2 SET_CC operands into a csel
instruction. The total instruction sequence uses an extra instruction and
register. Preventing this allows us to match a `(add, csel)` pattern and
rewrite this into a `cinc`.

Differential Revision: https://reviews.llvm.org/D98704
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/lib/Target/AArch64/AArch64InstrInfo.td
llvm/test/CodeGen/AArch64/arm64-csel.ll
llvm/test/CodeGen/AArch64/half.ll