[PATCH] D53420: [IAI, LV] Avoid creating a scalar epilogue due to gaps in interleave-groups when optimizing for size

Dorit Nuzman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 19 01:17:24 PDT 2018


dorit created this revision.
dorit added reviewers: Ayal, hsaito, dcaballe, fhahn.

LV is careful to respect -Os and not to create a scalar epilog in all cases (runtime tests, trip-counts that require a remainder loop) except for peeling due to gaps in interleave-groups. This patch fixes that; -Os will now have us invalidate such interleave-groups and vectorize without an epilog.

(Heads up: an upcoming patch will allow us to vectorize such interleave-group-with-gaps using masking instead of peeling, so we won't have to invalidate such groups for targets that support masked interleaving).

The patch also removes a related FIXME comment that is now obsolete, and was also inaccurate :  
"FIXME: return None if loop requiresScalarEpilog(<MaxVF>), or look for a smaller MaxVF that does not require a scalar epilog."
(requiresScalarEpilog()  has nothing to do with VF).


https://reviews.llvm.org/D53420

Files:
  include/llvm/Analysis/VectorUtils.h
  lib/Analysis/VectorUtils.cpp
  lib/Transforms/Vectorize/LoopVectorize.cpp
  test/Transforms/LoopVectorize/X86/x86-interleaved-accesses-masked-group.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53420.170156.patch
Type: text/x-patch
Size: 12666 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181019/c08b7650/attachment.bin>


More information about the llvm-commits mailing list