[PATCH] D68814: [LV] Allow assume calls in predicated blocks.

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 21 13:55:01 PDT 2019


Ayal added a comment.

In D68814#1716053 <https://reviews.llvm.org/D68814#1716053>, @fhahn wrote:

> In D68814#1707477 <https://reviews.llvm.org/D68814#1707477>, @Ayal wrote:
>
> > If conditional assumes are to be dropped, better do so on entry to VPlan, as in DeadInstructions, rather than representing them in ReplicateRecipe (as do unconditional assumes) and silencing their code generation.
> >
> > To retain conditional assumes along with their control flow, they could be marked under isScalarWithPredication; but this complicates vectorization, plus what use are such assumes when all else is if-converted(?)
> >
> > Conditional assumes under uniform control flow could be retained, along with the uniform control flow they depend upon; this may be mostly relevant for outerloop vectorization.
>
>
> I thought it might be desirable to only drop the calls at the point where we know for certain that we cannot preserve them: when we emit them in a block that gets merge in its predecessor. By doing it in the recipe, it should also be applicable to the outer loop vectorization.  Alternatively we can drop them all as a first step, if that is preferred. Please let me know :)


I vote to simply drop conditional assumes as a first step, at this time. In any case it's better in general if decisions get represented explicitly in VPlan, rather than having such logic kick in during code-gen. (Even if a block gets merged in its predecessor, better also check that the latter has more than one successor.) Following D68577 <https://reviews.llvm.org/D68577> such assumes could be dropped as a VPlan-to-VPlan transformation.

> I think we should try too hard to retain them (through marking them as scalar-with-predication), as the benefit of them for the vectorized loop after the vectorizer is likely to be quite small.

should >> should not?

For the sake of completeness, note that a conditional assume could be retained even under predication, by combining its block predicate within the assume predicate. I.e., a conditional "if (c) assume (p)" can be converted to an unconditional "assume (c implies p)" or "assume (!c || p)".


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68814/new/

https://reviews.llvm.org/D68814





More information about the llvm-commits mailing list