[LoopVectorizer] Refine loop vectorizer's register usage calculator by ignoring speci...
authorCong Hou <congh@google.com>
Sun, 13 Dec 2015 08:44:08 +0000 (08:44 +0000)
committerCong Hou <congh@google.com>
Sun, 13 Dec 2015 08:44:08 +0000 (08:44 +0000)
commitc731de4630f28b4a4e0fba7d60fce473f7837783
treee0e6945a2374d6bc88058d20885d26083029878d
parentd11fee00824f9261f3ee7a9fc633fd409d3e3ac2
[LoopVectorizer] Refine loop vectorizer's register usage calculator by ignoring specific instructions.

LoopVectorizationCostModel::calculateRegisterUsage() is used to estimate the
register usage for specific VFs. However, it takes into account many
instructions that won't be vectorized, such as induction variables,
GetElementPtr instruction, etc.. This makes the loop vectorizer too conservative
when choosing VF. In this patch, the induction variables that won't be
vectorized plus GetElementPtr instruction will be added to ValuesToIgnore set
so that their register usage won't be considered any more.

Differential revision: http://reviews.llvm.org/D15177

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255454 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/LoopVectorize.cpp
test/Transforms/LoopVectorize/X86/vector_max_bandwidth.ll
test/Transforms/LoopVectorize/reg-usage.ll [new file with mode: 0644]