[PATCH] D78298: [LV] Invalidate cost model decisions along with interleave groups.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 17 02:08:50 PDT 2020


fhahn updated this revision to Diff 258264.
fhahn marked 3 inline comments as done.
fhahn added a comment.

Addressed comments.

In D78298#1986961 <https://reviews.llvm.org/D78298#1986961>, @Ayal wrote:

> Clarifying the summary a bit:
>
> > Cost-modeling decisions are tied to the compute interleave groups
> >  (widening decisions, scalar and uniform values). We [When] invalidating the
> >  interleave groups, those decisions also need to be invalidated.
>
>
>
> > Otherwise there is a mis-match during VPlan construction where no
> >  VPInterleave recipes are created and VPWidenMemoryRecipes are left
> >  around for instructions marked as interleaved. This happens if
> >  a vectorization factor is chosen for which computeMaxVF already computed
> >  the CM decisions.
>
> VPWidenMemoryRecipes created initially are indeed left around w/o converting them into VPInterleave recipes, but such conversion indeed should not take place, and these gather/scatter recipes may in fact be right. The crux is leaving around obsolete CM_Interleave (and dependent) markings of instructions along with their costs, instead of recalculating decisions, costs, and recipes.


Thanks Ayal, I'll update the description to

  Cost-modeling decisions are tied to the compute interleave groups
  (widening decisions, scalar and uniform values). When invalidating the
  interleave groups, those decisions also need to be invalidated.
  
  Otherwise there is a mis-match during VPlan construction.
  VPWidenMemoryRecipes created initially are left around w/o converting them
  into VPInterleave recipes. Such a conversion indeed should not take place,
  and these gather/scatter recipes may in fact be right. The crux is leaving around
  obsolete CM_Interleave (and dependent) markings of instructions along with
  their costs, instead of recalculating decisions, costs, and recipes.

Does that sound good?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78298

Files:
  llvm/include/llvm/Analysis/VectorUtils.h
  llvm/lib/Analysis/VectorUtils.cpp
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/test/Transforms/LoopVectorize/Hexagon/invalidate-cm-after-invalidating-interleavegroups.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78298.258264.patch
Type: text/x-patch
Size: 7138 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200417/159be23f/attachment.bin>


More information about the llvm-commits mailing list