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

--- Comment #2 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
(In reply to Alexander Monakov from comment #1)
> Lifting those insns from the L8 BB to the L10 BB requires duplicating them
> on all incoming edges targeting L8, doesn't it?
> 

No, because they're unused before L10.  If they are used then they can't be
moved. (note that L10 is only reachable from L8 as it's a branch in the loop).

> Why is decreasing live ranges important here?

two reasons, first we have to avoid prematurely creating the copies.

The loop has multiple exits, and the values are not relevant for all exits.

        mov     z29.d, z31.d
        mov     z27.d, z30.d

is being done because we increment the inductions in the same basic block.  But
the incremented value is not needed in L8.

for loop induction variables I suppose we can change the materialization point
in the vectorizer to deal with them that way, but that only takes care of
inductions and ideally we shouldn't perform operations before an exit if it's
not needed for that exit.

At the moment the vectorizer only deals with moving statements that are needed
for correctness.

Reply via email to