[PATCH] D18523: [TTI] Add hook for vector extract with extension

Matthew Simpson via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 28 13:49:02 PDT 2016


mssimpso created this revision.
mssimpso added reviewers: jmolloy, hfinkel, mcrosier.
mssimpso added a subscriber: llvm-commits.
Herald added subscribers: mzolotukhin, mcrosier, aemerson.

This change adds a new cost model hook for estimating the cost of vector extracts followed by zero- and sign-extensions. The motivating example for this change is the SMOV and UMOV instructions on AArch64. These instructions move data from vector to general purpose registers while performing the corresponding extension (sign-extend for SMOV and zero-extend for UMOV) at the same time. For these operations, TargetTransformInfo can assume the extensions are free and only report the cost of the vector extract. I've modified the SLP vectorizer to make use of the new hook.

Please note that this patch is a significantly scaled down version of D15816. This patch focuses on one specific operation (extract with extension) whereas the other patch sought to fully contextualize the cost model estimates.

http://reviews.llvm.org/D18523

Files:
  include/llvm/Analysis/TargetTransformInfo.h
  include/llvm/Analysis/TargetTransformInfoImpl.h
  include/llvm/CodeGen/BasicTTIImpl.h
  lib/Analysis/TargetTransformInfo.cpp
  lib/Target/AArch64/AArch64TargetTransformInfo.cpp
  lib/Target/AArch64/AArch64TargetTransformInfo.h
  lib/Transforms/Vectorize/SLPVectorizer.cpp
  test/Transforms/SLPVectorizer/AArch64/gather-reduce.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18523.51832.patch
Type: text/x-patch
Size: 10804 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160328/c3fda968/attachment.bin>


More information about the llvm-commits mailing list