On Thu, May 18, 2017 at 8:24 AM, Marc Glisse <marc.gli...@inria.fr> wrote: > Hello, > > just moving one simple transformation to match.pd. It is actually slightly > more general, because there is no point restricting to NOP conversions when > only the lowest bit matters. > > By the way, I was thinking of removing from fold-const.c the transformation > "If we have (A & C) == D where D & ~C != 0, convert this into 0." because it > is already handled by CCP. Would that be ok or does it still need an > equivalent match.pd version?
I think it's good to have a match.pd pattern given not all passes do bit-tracking and it can remove the need to iterate, say, FRE and CCP. Maybe it can even be usefully extended to arbitrary ops with using known-zero-bits (just guessing here, simply moving it using wide-int ops rather than fold for D & ~C works for me as well). > Bootstrap+testsuite on powerpc64le-unknown-linux-gnu. Ok. Thanks, Richard. > 2017-05-18 Marc Glisse <marc.gli...@inria.fr> > > * fold-const.c (fold_binary_loc): Move transformation... > * match.pd (C - X CMP X): ... here. > > -- > Marc Glisse