aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-patterns.cc
diff options
context:
space:
mode:
authorAndrew Pinski <apinski@marvell.com>2023-08-22 18:41:56 -0700
committerAndrew Pinski <apinski@marvell.com>2023-08-23 23:52:25 -0700
commitddd64a6ec3b38e18aefb9fcba50c0d9297e5e711 (patch)
treeac4cf56bde5bfabf623576c3289dcc91a86f995b /gcc/tree-vect-patterns.cc
parent7e05cd632fab458717af4d4431c9f7e43ad062ad (diff)
downloadgcc-ddd64a6ec3b38e18aefb9fcba50c0d9297e5e711.zip
gcc-ddd64a6ec3b38e18aefb9fcba50c0d9297e5e711.tar.gz
gcc-ddd64a6ec3b38e18aefb9fcba50c0d9297e5e711.tar.bz2
MATCH: remove negate for 1bit types
For 1bit types, negate is either undefined or don't change the value. In either cases we want to remove them. This patch adds a match pattern to do that. Also converting to a 1bit type we can remove the negate just like we already do for `&1` so this patch adds that too. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. Notes on the testcases: This patch is the last part to fix PR 95929; cond-bool-2.c testcase. bit1neg-1.c is a 1bit-field testcase where we could remove the assignment all the way in one case (which happened on the RTL level for some targets but not all). cond-bool-2.c is the reduced testcase of PR 95929. PR tree-optimization/95929 gcc/ChangeLog: * match.pd (convert?(-a)): New pattern for 1bit integer types. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/bit1neg-1.c: New test. * gcc.dg/tree-ssa/cond-bool-1.c: New test. * gcc.dg/tree-ssa/cond-bool-2.c: New test.
Diffstat (limited to 'gcc/tree-vect-patterns.cc')
0 files changed, 0 insertions, 0 deletions