[LegalizeTypes][NVPTX] Remove extra compare from fallback code for ISD::ADD in Expand...
authorCraig Topper <craig.topper@sifive.com>
Tue, 13 Sep 2022 16:07:56 +0000 (09:07 -0700)
committerCraig Topper <craig.topper@sifive.com>
Tue, 13 Sep 2022 16:07:56 +0000 (09:07 -0700)
commitefd5acf1201f593a70937b140da72e49b7d0e7b3
tree1a1a4579e6f2d865a9387a49bffc67a301717dfb
parent393a17b5d1d73cffa7d9cb5bf348a4a87e02b571
[LegalizeTypes][NVPTX] Remove extra compare from fallback code for ISD::ADD in ExpandIntRes_ADDSUB.

This is the ultimate fallback code if UADDO isn't supported.

If the target uses 0/1 we used one compare, but if the target doesn't
use 0/1 we emitted two compares. Regardless of boolean constants we
should only need to check that the Result is less than one of the
original operands. So we only need one compare.

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D133708
llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
llvm/test/CodeGen/NVPTX/add-sub-128bit.ll