[LV] Remove type restriction for vector phi creation

We previously only created a vector phi node for an induction variable if its
type matched the type of the canonical induction variable.

Differential Revision: https://reviews.llvm.org/D29776

llvm-svn: 294755
This commit is contained in:
Matthew Simpson
2017-02-10 16:15:26 +00:00
parent 6ea21852af
commit df124a7569
2 changed files with 13 additions and 6 deletions

View File

@@ -2421,8 +2421,7 @@ void InnerLoopVectorizer::widenIntInduction(PHINode *IV, TruncInst *Trunc) {
// Try to create a new independent vector induction variable. If we can't
// create the phi node, we will splat the scalar induction variable in each
// loop iteration.
if (VF > 1 && IV->getType() == Induction->getType() && Step &&
!shouldScalarizeInstruction(EntryVal)) {
if (VF > 1 && Step && !shouldScalarizeInstruction(EntryVal)) {
createVectorIntInductionPHI(ID, EntryVal);
VectorizedIV = true;
}