Remove AllUndef check from one of the loops in getVectorShuffle. It was already handl...
authorCraig Topper <craig.topper@gmail.com>
Thu, 8 Aug 2013 08:03:12 +0000 (08:03 +0000)
committerCraig Topper <craig.topper@gmail.com>
Thu, 8 Aug 2013 08:03:12 +0000 (08:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187965 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index bc6063c36d0bd6ead9533255e31433a8e19d24ca..66be160afecdc81fb91baf43034917f7502fe5be 100644 (file)
@@ -1351,17 +1351,13 @@ SDValue SelectionDAG::getVectorShuffle(EVT VT, SDLoc dl, SDValue N1,
     commuteShuffle(N1, N2, MaskVec);
   }
 
-  // If Identity shuffle, or all shuffle in to undef, return that node.
-  bool AllUndef = true;
+  // If Identity shuffle return that node.
   bool Identity = true;
   for (unsigned i = 0; i != NElts; ++i) {
     if (MaskVec[i] >= 0 && MaskVec[i] != (int)i) Identity = false;
-    if (MaskVec[i] >= 0) AllUndef = false;
   }
   if (Identity && NElts == N1.getValueType().getVectorNumElements())
     return N1;
-  if (AllUndef)
-    return getUNDEF(VT);
 
   FoldingSetNodeID ID;
   SDValue Ops[2] = { N1, N2 };