[RFA][PATCH][PR rtl-optimization/47477] Type narrowing in match.pd

Jeff Law law@redhat.com
Thu Feb 12 16:43:00 GMT 2015


On 02/12/15 00:01, Bin.Cheng wrote:
>
> Cool that we are trying to simplify type conversion using generic
> match facility.  I have thought about type promotion in match.pd too.
match.pd really feels like a meta-language which describes how to 
combine gimple or generic statements.


> For example, (unsigned long long)(unsigned long)(int_expr), if we can
> prove int_expr is always positive (in my case, this is from vrp
> information), then the first conversion can be saved.  This is another
> way for (and related? I didn't look at the code) the sign/zero
> extension elimination work using VRP I suppose?
In theory, given VRP information attached to an SSA_NAME you could query 
that information in the conditional part of the match.pd pattern.

Another patch I'm working on is best described as detecting cases where 
an outer bit-and masks off all the bits outside the innermost operand's 
type.  Under the right conditions, this also allows for narrowing.

Jeff



More information about the Gcc-patches mailing list