[AArch64] Ensure condition (SUBS) has no uses of value in performCONDCombine
authorDavid Green <david.green@arm.com>
Tue, 4 Oct 2022 20:18:30 +0000 (21:18 +0100)
committerDavid Green <david.green@arm.com>
Tue, 4 Oct 2022 20:18:30 +0000 (21:18 +0100)
commitcf43154bc37540f32d0a345b7d5aa99d21f73cee
treece844af6b30f250f21d5f23b57c115bec7577ecf
parent2e1c1d6d72879cafc339ad035b1b5a6d1c8cc130
[AArch64] Ensure condition (SUBS) has no uses of value in performCONDCombine

performCONDCombine removes and 0xff in patterns of
SUBS (and (add(..), 0xff), C)
under certain complex conditions. It doesn't come up often,
but in the lowering of usub.sat where the SUBS is both used as a
condition and as a value, the And is removed where it would only be
valid for the condition.

Fixes #58109.

Differential Revision: https://reviews.llvm.org/D135043
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/test/CodeGen/AArch64/and-mask-removal.ll