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] PR tree-optimization/43833


On Wed, Apr 21, 2010 at 5:13 PM, Paolo Bonzini <bonzini@gnu.org> wrote:
> On 04/21/2010 04:46 PM, Jie Zhang wrote:
>>
>> + ? ? ?bool vr0_constant_p, vr1_constant_p;
>> +
>> + ? ? ?vr0_constant_p = (vr0.type == VR_RANGE
>> + ? ? ? ? ? ? ? ? ? ? ? && ?vr0.min == vr0.max
>
> operand_equal_p (vr0.min, vr0.max, 0)
>
>> + ? ? ? ? ? ? ? ? ? ? ? && ?TREE_CODE (vr0.max) == INTEGER_CST
>
> This check then becomes cheaper than operand_equal_p, so do it first.
>
>> + ? ? ? ? ? ? ? ? ? ? ? && ?!TREE_OVERFLOW (vr0.max));
>> + ? ? ?vr1_constant_p = (vr1.type == VR_RANGE
>> + ? ? ? ? ? ? ? ? ? ? ? && ?vr1.min == vr1.max
>> + ? ? ? ? ? ? ? ? ? ? ? && ?TREE_CODE (vr1.max) == INTEGER_CST
>> + ? ? ? ? ? ? ? ? ? ? ? && ?!TREE_OVERFLOW (vr1.max));
>> +
>> + ? ? ?if (vr0_constant_p&& ?vr1_constant_p)
>
> I also looked at op_with_constant_singleton_value_range while reviewing this
> patch, and noticed it lacks the !TREE_OVERFLOW check. ?Maybe you can
> introduce range_single_constant_value, and use it also in
> op_with_constant_singleton_value_range?

Well... my evil plan was to stop re-implementing CCP inside VRP
and instead keep a ccp_lattice on-the side and call CCPs
ccp_fold for all the singleton constant-folding.  Thus, export
ccp_fold, give it a lattice argument and maintain a ccp lattice
inside VRP (and maybe DOM).  Maintaining the ccp_lattice
should be easy from inside set_value_range*.  All that needs
to be done then is to implement a likely_value for VRP so we
don't call ccp_fold unnecessarily often.

Richard.

> Thanks,
>
> Paolo
>


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