]> gcc.gnu.org Git - gcc.git/commit
MATCH: `(nop_convert)-(convert)a` into -(convert)a if we are converting from somethin...
authorAndrew Pinski <apinski@marvell.com>
Thu, 31 Aug 2023 23:17:35 +0000 (16:17 -0700)
committerAndrew Pinski <apinski@marvell.com>
Tue, 5 Sep 2023 21:14:54 +0000 (14:14 -0700)
commite6bcf83989478348428c732c11e6c0f1719e9214
tree44a1984bbcaf5cc77e7837e22cf2049589e9fc80
parent244d1321340116b7780e78096356f69662fd0e18
MATCH: `(nop_convert)-(convert)a` into -(convert)a if we are converting from something smaller

This allows removal of one conversion and in the case of booleans, might be able to remove
the negate and the other conversion later on.

OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

PR tree-optimization/107137

gcc/ChangeLog:

* match.pd (`(nop_convert)-(convert)a`): New pattern.

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/neg-cast-2.c: New test.
* gcc.dg/tree-ssa/neg-cast-3.c: New test.
gcc/match.pd
gcc/testsuite/gcc.dg/tree-ssa/neg-cast-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/neg-cast-3.c [new file with mode: 0644]
This page took 0.064016 seconds and 6 git commands to generate.