[LV] Move VectorParts allocation and mapping into PHI widening (NFC)
authorMatthew Simpson <mssimpso@codeaurora.org>
Thu, 1 Sep 2016 18:14:27 +0000 (18:14 +0000)
committerMatthew Simpson <mssimpso@codeaurora.org>
Thu, 1 Sep 2016 18:14:27 +0000 (18:14 +0000)
commit922af076c70f2a7d7d997af5bd5ca218ae609e70
tree6eae785efd3f688280566aeeac718af6e4e2aa28
parentdf43d25fd366d96cd7af1ead8938ed0d2394e2fb
[LV] Move VectorParts allocation and mapping into PHI widening (NFC)

This patch moves the allocation of VectorParts for PHI nodes into the actual
PHI widening code. Previously, we allocated these VectorParts in
vectorizeBlockInLoop, and passed them by reference to widenPHIInstruction. Upon
returning, we would then map the VectorParts in VectorLoopValueMap. This
behavior is problematic for the cases where we only want to generate a scalar
version of a PHI node. For example, if in the future we only generate a scalar
version of an induction variable, we would end up inserting an empty vector
entry into the map once we return to vectorizeBlockInLoop. We now no longer
need to pass VectorParts to the various PHI widening functions, and we can keep
VectorParts allocation as close as possible to the point at which they are
actually mapped in VectorLoopValueMap.

llvm-svn: 280390
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp