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

--- Comment #12 from Artemiy Volkov <artemiy at synopsys dot com> ---
(In reply to Andrew Pinski from comment #11)
> (In reply to Artemiy Volkov from comment #10)
> > 
> > CMIIW, but this live range splitting is done a bit later by web and works
> > well in the case where those pseudos' live ranges can be split without
> > changing the CFG.  To handle the case when multiple definitions of a
> > variable are visible at the exit BB, you need to create copies of the exit
> > BB before you can rename the variable, which is what I do in this patch.
> 
> I am not sure you need a copy of the exit BB but rather splitting the edge
> and do an insert of a move on the new BB and allow the other parts of GCC do
> the copy ...
> 
> This is basically what out of SSA does rather than a full exit BB copy.

Right.  I am not sure why I said "copies of the exit BB".  The patch splits the
exit edge N times, where N is the unroll factor.  In each of the new exit BBs
it inserts a move instruction for each variable defined in the loop and live in
at the old exit BB.  This has the effect of splitting the DU chains of those
variables.  Then I rename the resulting DU chains when feasible.  And yes, it
is emulating an effect of a phi-function at the entry to the exit BB.

Reply via email to