[TTI] Add hook for vector extract with extension
authorMatthew Simpson <mssimpso@codeaurora.org>
Wed, 27 Apr 2016 15:20:21 +0000 (15:20 +0000)
committerMatthew Simpson <mssimpso@codeaurora.org>
Wed, 27 Apr 2016 15:20:21 +0000 (15:20 +0000)
commite5dfb08fcb8040ebd39b2098ca74bc809cf8e914
tree3a79dcfc4dffb300163e4088395d4ac682afe867
parent5cd55b17848e16ba170e2898a5f426bcde3f350f
[TTI] Add hook for vector extract with extension

This change adds a new 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. The SLP vectorizer has been updated to
make use of the new hook.

Differential Revision: http://reviews.llvm.org/D18523

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