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]

Re: [patch tree-optimization]: [3 of 3]: Boolify compares & more


Hi,

On Fri, 8 Jul 2011, Kai Tietz wrote:

> This is the reworked patch, It fixes vrp to handle bitwise one-bit 
> precision typed operations and to handle some type hoisting cases, Some 
> cases can't be handled as long as vrp doesn't allows to insert new 
> statements in folding pass. To have in first pass better match, VRP uses 
> for stmt-folding now for each BB first -> last stepping.  I extended for 
> this function substitute_and_fold function by an new argument, which 
> indicates if scanning within BB shall be done from first to last, or 
> from last to first. I removed in this new patch the part of re-doing 
> stmt-fold pass, as this is no longer necessary by changing folding 
> direction within BB.

You still add BIT_IOR_EXPR for POINTER_TYPE_P, which seems strange.  All 
these test for TYPE_PRECISION being 1 (and then handling BIT_IOR/AND_EXPR 
like TRUTH_IOR/AND_EXPR) aren't necessary if you extend the general 
handling for BIT_IOR_EXPR (for instance) to deal with not only constant 
1, but simply handling all-ones constants specially.  That is replace 
integer_onep with integer_all_onesp at certain places.

Because also for wider than 1-bit precision it's the case that we can 
infer usefull ranges out of "VARYING | all-ones".

Certainly the special casing on 1-bit is ugly.  Work towards making 
tree-vrp more lean and handling cases more general instead of piling 
special case over special case.


Ciao,
Michael.


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