This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR tree-optimization/43833
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Paolo Bonzini <bonzini at gnu dot org>
- Cc: Jie Zhang <jie at codesourcery dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 21 Apr 2010 17:44:28 +0200
- Subject: Re: [PATCH] PR tree-optimization/43833
- References: <4BCF0FB5.607@codesourcery.com> <4BCF162F.9020600@gnu.org>
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
>