This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PR51752] publication safety violations in loop invariant motion pass
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Aldy Hernandez <aldyh at redhat dot com>
- Cc: Richard Henderson <rth at redhat dot com>, Torvald Riegel <triegel at redhat dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 6 Mar 2012 21:18:34 +0100
- Subject: Re: [PR51752] publication safety violations in loop invariant motion pass
- Authentication-results: mr.google.com; spf=pass (google.com: domain of richard.guenther@gmail.com designates 10.50.181.132 as permitted sender) smtp.mail=richard.guenther@gmail.com; dkim=pass header.i=richard.guenther@gmail.com
- References: <4F46833C.2090808@redhat.com> <4F46AB9D.7050407@redhat.com> <CAFiYyc2norU+9V0fBhdkz7R_mFeS7gzBHOAqDnuH-HMZejXyew@mail.gmail.com> <1330089023.2986.3085.camel@triegel.csb> <CAFiYyc3RHUsUxxEnWswsrGMWtXXkxpxD3OHc_S3z-FfgxN7Ysw@mail.gmail.com> <4F4BADD1.1090407@redhat.com> <4F4D0965.8020108@redhat.com> <4F4D1277.9080206@redhat.com> <4F4D2719.5000209@redhat.com> <4F4D3504.90005@redhat.com> <CAFiYyc3pOAosTe8a8KOWdjH+J6JXQjaXPUr8AJr6C_JDdmHPew@mail.gmail.com> <4F564F7E.3010300@redhat.com>
On Tue, Mar 6, 2012 at 6:55 PM, Aldy Hernandez <aldyh@redhat.com> wrote:
> On 02/29/12 03:22, Richard Guenther wrote:
>
>> So fixing up individual passes is easier - I can only think of PRE being
>> problematic right now, I am not aware that any other pass moves loads
>> or stores. ?So I'd simply pre-compute the stmt bit in PRE and adjust
>> the
>>
>> ? ? ? ? ? if (gimple_has_volatile_ops (stmt)
>> ? ? ? ? ? ? ? || stmt_could_throw_p (stmt))
>> ? ? ? ? ? ? continue;
>>
>> in compute_avail accordingly.
>
>
> Initially I thought PRE would be problematic for transactions, but perhaps
> it isn't. ?As I understand, for PRE we hoist loads/computations that are
> mostly redundant, but will be performed on every path:
>
> ? ? ? ?if (flag)
> ? ? ? ? ? ? ? ?a = b + c;
> ? ? ? ?else
> ? ? ? ? ? ? ? ?stuff;
> ? ? ? ?d = b + c; ? ? ? ? ? ? ?<-- [b + c] always computed
>
> Even if we hoist [b + c] before the flag, [b + c] will be computed on every
> path out of "if (flag)...". ?So... we can allow this transformation within
> transactions, right?
Note that partial PRE (enabled at -O3) can insert expressions into paths
that did _not_ execute the expression. For regular PRE you are right.
Richard.
> Torvald?