]> granicus.if.org Git - clang/commitdiff
Remove broken and unnecessary vec3 handling from VisitShuffleVectorExpr.
authorCraig Topper <craig.topper@gmail.com>
Thu, 1 Aug 2013 04:51:48 +0000 (04:51 +0000)
committerCraig Topper <craig.topper@gmail.com>
Thu, 1 Aug 2013 04:51:48 +0000 (04:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187558 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExprScalar.cpp

index d0b4ef4ef09de44a26c1576a67f26a84e2215778..d3250ea646383fa743db25fdd0472da9cb7aa2d2 100644 (file)
@@ -969,13 +969,9 @@ Value *ScalarExprEmitter::VisitShuffleVectorExpr(ShuffleVectorExpr *E) {
   Value* V1 = CGF.EmitScalarExpr(E->getExpr(0));
   Value* V2 = CGF.EmitScalarExpr(E->getExpr(1));
 
-  // Handle vec3 special since the index will be off by one for the RHS.
-  llvm::VectorType *VTy = cast<llvm::VectorType>(V1->getType());
   SmallVector<llvm::Constant*, 32> indices;
-  for (unsigned i = 2; i < E->getNumSubExprs(); i++) {
+  for (unsigned i = 2; i < E->getNumSubExprs(); ++i) {
     unsigned Idx = E->getShuffleMaskIdx(CGF.getContext(), i-2);
-    if (VTy->getNumElements() == 3 && Idx > 3)
-      Idx -= 1;
     indices.push_back(Builder.getInt32(Idx));
   }