On Tue, Mar 6, 2012 at 6:55 PM, Aldy Hernandez <al...@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?

Reply via email to