From ad5ccc2d750fce59d41c4b63a489d59443810cfc Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Thu, 1 Aug 2013 06:59:29 +0000 Subject: [PATCH] Remove more odd code that tries to account for an off by 1 problem in vec3 shuffles that doesn't really exist. llvm-svn: 187561 --- clang/lib/CodeGen/CGExprScalar.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp index c0355f690de1..9ab111c4935c 100644 --- a/clang/lib/CodeGen/CGExprScalar.cpp +++ b/clang/lib/CodeGen/CGExprScalar.cpp @@ -944,14 +944,6 @@ Value *ScalarExprEmitter::VisitShuffleVectorExpr(ShuffleVectorExpr *E) { Value *Indx = Builder.CreateExtractElement(Mask, IIndx, "shuf_idx"); Indx = Builder.CreateZExt(Indx, CGF.Int32Ty, "idx_zext"); - // Handle vec3 special since the index will be off by one for the RHS. - if ((LHSElts == 6) && (E->getNumSubExprs() == 3)) { - Value *cmpIndx, *newIndx; - cmpIndx = Builder.CreateICmpUGT(Indx, Builder.getInt32(3), - "cmp_shuf_idx"); - newIndx = Builder.CreateSub(Indx, Builder.getInt32(1), "shuf_idx_adj"); - Indx = Builder.CreateSelect(cmpIndx, newIndx, Indx, "sel_shuf_idx"); - } Value *VExt = Builder.CreateExtractElement(LHS, Indx, "shuf_elt"); NewV = Builder.CreateInsertElement(NewV, VExt, IIndx, "shuf_ins"); }