>                     || vsetvl_insn_p (expr.get_insn ()->rtl ()))
>                   continue;
>                 new_info = expr.global_merge (expr, eg->src->index);
> @@ -3317,6 +3335,25 @@ pass_vsetvl::earliest_fusion (void)
>                     prob = profile_probability::uninitialized ();
>                   }
>                 else if (!src_block_info.reaching_out.compatible_p (expr)
> +                        /* We don't do fusion across BBs for user explicit
> +                           vsetvl instruction for these following reasons:
> +
> +                            - The user vsetvl instruction is configured as
> +                              no side effects that the previous passes
> +                              (GSCE, Loop-invariant, ..., etc)
> +                              should be able to do a good job on optimization
> +                              of user explicit vsetvls so we don't need to
> +                              PRE optimization (The user vsetvls should be
> +                              on the optimal local already before this pass)
> +                              again for user vsetvls in VSETVL PASS here
> +                              (Phase 3 && Phase 4).
> +
> +                            - Allowing user vsetvls be optimized in PRE
> +                              optimization here (Phase 3 && Phase 4) will
> +                              complicate the codes so much so we prefer user
> +                              vsetvls be optimized in post-optimization
> +                              (Phase 5 && Phase 6).  */
> +                        && !vsetvl_insn_p (expr.get_insn ()->rtl ())
>                          && dest_block_info.probability
>                               > src_block_info.probability)

This is OK but do we need the same comment twice?  The first one doesn't
seem to refer to a change but also to vsetvl_insn_p (expr.get_insn()...).

And where is the !empty block property enforced?  I would prefer to have
the longer comment at a top level and shortly describe here why
!vsetvl_insn_p ensures we don't have an EMPTY block.  Don't we usually
have a state for this (i.e. empty_p)?

No need for a V2 though, it can also stay as is and be cleaned up later.

Regards
 Robin

Reply via email to