[PATCH] D26277: [SLP] Fixed cost model for horizontal reduction.

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 3 04:27:03 PDT 2016


ABataev created this revision.
ABataev added reviewers: hfinkel, mkuper, mzolotukhin.
ABataev added subscribers: llvm-commits, spatel, RKSimon.

Currently when cost of scalar operations is evaluated the vector type is used for scalar operations. Patch fixes this issue and fixes evaluation of the vector operations cost.
Several test showed that vector cost model is too optimistic. It allowed vectorization of 8 or less `add/fadd` operations, though scalar code is faster. Actually, only for 16 or more operations vector code provides better performance.


https://reviews.llvm.org/D26277

Files:
  include/llvm/CodeGen/BasicTTIImpl.h
  lib/Transforms/Vectorize/SLPVectorizer.cpp
  test/Analysis/CostModel/X86/reduction.ll
  test/Transforms/SLPVectorizer/AArch64/gather-root.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26277.76836.patch
Type: text/x-patch
Size: 11584 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161103/dabde299/attachment.bin>


More information about the llvm-commits mailing list