On Tue, Jun 28, 2011 at 5:05 PM, Kai Tietz <kti...@redhat.com> wrote: > Hello, > > this patch implements the X op !X patterns within tree-ssa-forwprop.c without > using here const-fold routines. Additionally it does some trivial folding > for X op X. Implementation > also looks through [(type)] X op [(type)] !X, if type of X is integral and > precision is suitable > for operation. > > ChangeLog gcc/ > > 2011-06-28 Kai Tietz <kti...@redhat.com> > > * tree-ssa-forwprop.c (operand_precision_onep): New > function. > (find_possible_not_expr_argument): Likewise. > (simplify_bitwise_binary_1): Likewise. > (simplify_bitwise_binary): Use simplify_bitwise_binary_1 > for detecting various X op !X optimizations. > > ChangeLog gcc/testsuite > > 2011-06-28 Kai Tietz <kti...@redhat.com> > > * gcc.dg/binop-notand1a.c: New test. > * gcc.dg/binop-notand2a.c: New test. > * gcc.dg/binop-notand3a.c: New test. > * gcc.dg/binop-notand4a.c: New test. > * gcc.dg/binop-notand5a.c: New test. > * gcc.dg/binop-notand6a.c: New test. > * gcc.dg/binop-notor1.c: New test. > * gcc.dg/binop-notor2.c: New test. > * gcc.dg/binop-notxor1.c: New test. > * gcc.dg/binop-notxor2.c: New test. > > Bootstrapped and regression tested for all languages plus Ada and Obj-C for > x86_64-pc-linux-gnu. Ok for apply?
I can't follow the code in find_possible_not_expr_argument or its uses at all. Please try to produce patches that look more obvious in what they are doing - don't try to solve every testcase you can come up with in a single patch. Especially don't write functions like find_possible_not_expr_argument which seems to have evolved a lot after you wrote the overall function comment. Thanks, Richard. > Regards, > Kai >