[AArch64] Select to CCMN when the CCMP's second operator is negative constant
authorchenglin.bi <chenglin.bi@linaro.org>
Fri, 14 Oct 2022 13:40:55 +0000 (21:40 +0800)
committerchenglin.bi <chenglin.bi@linaro.org>
Fri, 14 Oct 2022 13:41:25 +0000 (21:41 +0800)
commit85e41fcaacc88b7f9e1d3ad27545d5c6edcbacef
tree00a714936433e2a4edd5cf10312db940449ac882
parent6d252a48884f12bd5f48764e3b25e1dfb81f00cd
[AArch64] Select to CCMN when the CCMP's second operator is negative constant

CCMP/CCMN's second operator support const from 0 to 31. When the CCMP's second operator is in the range [-31, -1] we can replace it with CCMN to avoid extra mov.

Fix: #57034

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D135939
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/test/CodeGen/AArch64/arm64-ccmp.ll