[AArch64][GISel] Optimize 8 and 16 bit variants of uaddo.
authorFlorian Hahn <flo@fhahn.com>
Fri, 5 Nov 2021 16:45:49 +0000 (17:45 +0100)
committerFlorian Hahn <flo@fhahn.com>
Fri, 5 Nov 2021 18:11:15 +0000 (19:11 +0100)
commitf64580f8d2ce5e1161857f9c89c2eee7a74c5ab8
tree3a3b6c939a9fbb1779d222424ab080ba39505640
parent97c899f3c5d9bbff2824b3252b21378bf96f3f3f
[AArch64][GISel] Optimize 8 and 16 bit variants of uaddo.

Try simplify G_UADDO with 8 or 16 bit operands to wide G_ADD and TBNZ if
result is only used in the no-overflow case. It is restricted to cases
where we know that the high-bits of the operands are 0. If there's an
overflow, then the the 9th or 17th bit must be set, which can be checked
using TBNZ.

Reviewed By: paquette

Differential Revision: https://reviews.llvm.org/D111888
llvm/lib/Target/AArch64/GISel/AArch64PreLegalizerCombiner.cpp
llvm/test/CodeGen/AArch64/GlobalISel/uaddo-8-16-bits.mir