r187561 - Remove more odd code that tries to account for an off by 1 problem in vec3 shuffles that doesn't really exist.

Craig Topper craig.topper at gmail.com
Wed Jul 31 23:59:29 PDT 2013


Author: ctopper
Date: Thu Aug  1 01:59:29 2013
New Revision: 187561

URL: http://llvm.org/viewvc/llvm-project?rev=187561&view=rev
Log:
Remove more odd code that tries to account for an off by 1 problem in vec3 shuffles that doesn't really exist.

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=187561&r1=187560&r2=187561&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprScalar.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprScalar.cpp Thu Aug  1 01:59:29 2013
@@ -944,14 +944,6 @@ Value *ScalarExprEmitter::VisitShuffleVe
       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");
     }





More information about the cfe-commits mailing list