aboutsummaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorAndrew Pinski <apinski@marvell.com>2023-01-31 05:03:21 +0000
committerAndrew Pinski <apinski@marvell.com>2023-02-14 21:44:21 +0000
commita42ed1d9181d21d5cb02f131f641c0cf375eca9d (patch)
tree47836e2e44e7b4292edfa155c683981366dcbc98 /libgomp
parent7e300a3d04c18825596ba825c0bbd0cce719ea89 (diff)
downloadgcc-a42ed1d9181d21d5cb02f131f641c0cf375eca9d.zip
gcc-a42ed1d9181d21d5cb02f131f641c0cf375eca9d.tar.gz
gcc-a42ed1d9181d21d5cb02f131f641c0cf375eca9d.tar.bz2
Simplify "1 - bool_val" to "bool_val ^ 1"
For bool values, it is easier to deal with xor 1 rather than having 1 - a. This is because we are more likely to simplify the xor further in many cases. This is a special case for (MASK - b) where MASK is a powerof2 - 1 and b <= MASK but only for bool ranges ([0,1]) as that is the main case where the difference comes into play. Note this is enabled for gimple folding only as the ranges are only know while doing gimple folding and cfun is not always set when fold is called. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: PR tree-optimization/108355 PR tree-optimization/96921 * match.pd: Add pattern for "1 - bool_val". gcc/testsuite/ChangeLog: PR tree-optimization/108355 PR tree-optimization/96921 * gcc.dg/tree-ssa/bool-minus-1.c: New test. * gcc.dg/tree-ssa/bool-minus-2.c: New test. * gcc.dg/tree-ssa/pr108354-1.c: New test.
Diffstat (limited to 'libgomp')
0 files changed, 0 insertions, 0 deletions