r187558 - Remove broken and unnecessary vec3 handling from VisitShuffleVectorExpr.

Craig Topper craig.topper at gmail.com
Wed Jul 31 21:51:48 PDT 2013


Author: ctopper
Date: Wed Jul 31 23:51:48 2013
New Revision: 187558

URL: http://llvm.org/viewvc/llvm-project?rev=187558&view=rev
Log:
Remove broken and unnecessary vec3 handling from VisitShuffleVectorExpr.

Modified:
    cfe/trunk/lib/CodeGen/CGExprScalar.cpp

Modified: cfe/trunk/lib/CodeGen/CGExprScalar.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprScalar.cpp?rev=187558&r1=187557&r2=187558&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprScalar.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprScalar.cpp Wed Jul 31 23:51:48 2013
@@ -969,13 +969,9 @@ Value *ScalarExprEmitter::VisitShuffleVe
   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));
   }
 





More information about the cfe-commits mailing list