[PATCH] D37507: Fix maximum legal VF calculation

Alon Kom via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 6 00:35:16 PDT 2017


alonkom created this revision.

This patch fixes pr34283, which exposed that the computation of maximum legal width for vectorization was wrong, because it relied on MaxInterleaveFactor to obtain the maximum stride used in the loop, however not all strided accesses in the loop have an interleave-group associated with them. In pr34283 the interleave group gets invalidated because it is a store with gaps; as a result MaxInterleaveFactor is 1, and the computed maximum legal width for vectorization comes out larger than it should be. 
Instead of recording the maximum stride in the loop, which can be over conservative (e.g. if the access with the maximum stride is not involved in the dependence limitation), this patch tracks the actual maximum legal width imposed by accesses that are involved in dependencies.


https://reviews.llvm.org/D37507

Files:
  include/llvm/Analysis/LoopAccessAnalysis.h
  lib/Analysis/LoopAccessAnalysis.cpp
  lib/Transforms/Vectorize/LoopVectorize.cpp
  test/Transforms/LoopVectorize/X86/pr34283-1.ll
  test/Transforms/LoopVectorize/X86/pr34283-2.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37507.113962.patch
Type: text/x-patch
Size: 8536 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170906/17d27c8a/attachment.bin>


More information about the llvm-commits mailing list