This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Implement (a & B) OP0 (c & B) into (a OP0 c) & B simplifying into forwprop


Hi,
  I noticed a missed simple optimization on the tree level where the
and expression could be commoned out.
This patch implements the optimization in tree-ssa-forwprop.c.   I
thought it would be good to get it in even before my tree combiner
work gets in (which I am still working on but recently ran into a git
merging issue which I am still trying to resolve).

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

ChangeLog:
* tree-ssa-forwprop.c (simplify_bitwise_binary): Simplify (A & B) OP0
(C & B) to (A OP0) & B.

testsuite/ChangeLog:
* gcc.dg/tree-ssa/forwprop-17.c: New testcase.

Attachment: addANDopt.diff.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]