https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77362

--- Comment #10 from Sebastian Pop <spop at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #9)
> Yeah, but the user can write such dependences himself so ideally we have
> a way to undo them, like by using local scratch memory?  So

You are right.  LLVM-Polly has a pass that undoes LIM, it is non trivial, and
furthermore we'd better catch the LIM once the loop transforms are done!

> 
>   x_0 = 1;
> 
> loop:
>   # x_1 = PHI <x_0, x_2>
>   ...
>   x_2 = ...;
>   goto loop;
> 
> turns into
> 
>   mem = 1;
>   
> loop:
>   x_1 = mem;
>   x_2 = ...;
>   mem = x_2;
>   goto loop;
> 
> plus replacement of exit PHIs with loads.  Would that help?

That's how we were handling reductions and end of loop values in the dependence
graph.  Today we can reason about scalars themselves and add the scalars to the
dependence graph instead of generating the loads that would need to be cleaned
up after graphite.

Reply via email to