]> git.ipfire.org Git - thirdparty/gcc.git/commit
MATCH: add some of what phiopt's builtin_zero_pattern did
authorAndrew Pinski <apinski@marvell.com>
Sun, 9 Apr 2023 01:46:37 +0000 (18:46 -0700)
committerAndrew Pinski <apinski@marvell.com>
Sun, 30 Apr 2023 20:35:36 +0000 (13:35 -0700)
commitc53237cefbad0c52799927d6fd99775426a8a92a
treede10d15a2276f0cbe6ce3d5617e3e027e594ea0c
parent55b708895149ac5e108f50150e12a3c5ba00e83d
MATCH: add some of what phiopt's builtin_zero_pattern did

This adds the patterns for
POPCOUNT BSWAP FFS PARITY CLZ and CTZ.
For "a != 0 ? FUNC(a) : CST".
CLRSB, CLRSBL, and CLRSBLL will be moved next.

Note this is not enough to remove
cond_removal_in_builtin_zero_pattern as we need to handle
the case where there is an NOP_CONVERT inside the conditional
to move out of the condition inside match_simplify_replacement.

OK? Bootstrapped and tested on x86_64-linux-gnu.

gcc/ChangeLog:

* match.pd: Add patterns for "a != 0 ? FUNC(a) : CST"
for FUNC of POPCOUNT BSWAP FFS PARITY CLZ and CTZ.
gcc/match.pd