This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 3/4 v2] Enhance SCEV to follow copies of SSA_NAMEs.
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Alan Lawrence <alan dot lawrence at foss dot arm dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 15 Jan 2016 11:41:22 +0100
- Subject: Re: [PATCH 3/4 v2] Enhance SCEV to follow copies of SSA_NAMEs.
- Authentication-results: sourceware.org; auth=none
- References: <CAFiYyc2jLVDQRr-Ty=zCEwfwhXrvX_8BbVO6GitZoewOxYXdiA at mail dot gmail dot com> <1452851274-17294-1-git-send-email-alan dot lawrence at arm dot com> <CAFiYyc0m_YkHA2pwGMTc5O2JT=gnfHuh9E4V4J+XCQyOC=kEcQ at mail dot gmail dot com> <5698CC12 dot 8000200 at foss dot arm dot com>
On Fri, Jan 15, 2016 at 11:38 AM, Alan Lawrence
<alan.lawrence@foss.arm.com> wrote:
> On 15/01/16 10:07, Richard Biener wrote:
>>
>> On Fri, Jan 15, 2016 at 10:47 AM, Alan Lawrence <alan.lawrence@arm.com>
>> wrote:
>>>
>>> On Thu, Jan 14, 2016 at 12:30 PM, Richard Biener
>>> <richard.guenther@gmail.com> wrote:
>>>
>>>>
>>>> The vuse test is not necessary
>>>>
>>>>> + && (gimple_assign_rhs_code (def) == SSA_NAME
>>>>> + || is_gimple_min_invariant (gimple_assign_rhs1
>>>>> (def))))
>>>>
>>>>
>>>> and the is_gimple_min_invariant (rhs1) test is not sufficient if you
>>>> consider - (-INT_MIN) with -ftrapv for example.
>>>
>>>
>>> Thanks, I didn't realize gimple_min_invariant would allow such cases.
>>
>>
>> Well, the invariant would be -INT_MIN but gimple_assign_rhs_code (def)
>> would
>> be NEGATE_EXPR. Basically you forgot about unary operators.
>
>
> Hmm, shouldn't those have get_gimple_rhs_class(gimple_assign_rhs_code(stmt))
> == GIMPLE_UNARY_RHS, rather than GIMPLE_SINGLE_RHS as checked for by
> gimple_assign_single_p?
Doh, of course.
> If SINGLE_RHS includes unary operators, the new version of the patch is as
> flawed as the previous, in that it drops the unary operator altogether.
>
> --Alan