-
- Downloads
MATCH: [PR110937/PR100798] (a ? ~b : b) should be optimized to b ^ -(a)
This adds a simple match pattern for this case. I noticed it a couple of different places. One while I was looking at code generation of a parser and also while I was looking at locations where bitwise_inverted_equal_p should be used more. Committed as approved after bootstrapped and tested on x86_64-linux-gnu with no regressions. PR tree-optimization/110937 PR tree-optimization/100798 gcc/ChangeLog: * match.pd (`a ? ~b : b`): Handle this case. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/bool-14.c: New test. * gcc.dg/tree-ssa/bool-15.c: New test. * gcc.dg/tree-ssa/phi-opt-33.c: New test. * gcc.dg/tree-ssa/20030709-2.c: Update testcase so `a ? -1 : 0` is not used to hit the match pattern.
Showing
- gcc/match.pd 14 additions, 0 deletionsgcc/match.pd
- gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c 3 additions, 2 deletionsgcc/testsuite/gcc.dg/tree-ssa/20030709-2.c
- gcc/testsuite/gcc.dg/tree-ssa/bool-14.c 15 additions, 0 deletionsgcc/testsuite/gcc.dg/tree-ssa/bool-14.c
- gcc/testsuite/gcc.dg/tree-ssa/bool-15.c 18 additions, 0 deletionsgcc/testsuite/gcc.dg/tree-ssa/bool-15.c
- gcc/testsuite/gcc.dg/tree-ssa/phi-opt-33.c 13 additions, 0 deletionsgcc/testsuite/gcc.dg/tree-ssa/phi-opt-33.c
Loading
Please register or sign in to comment