From: Craig Topper Date: Wed, 18 May 2016 04:11:25 +0000 (+0000) Subject: [Sema,CodeGen] Remove comment from SemaChecking about a builtin_shufflevector form... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=207af25c956645ef171ef81688878030f9a67de4;p=clang [Sema,CodeGen] Remove comment from SemaChecking about a builtin_shufflevector form that it doesn't support. Remove CodeGen support for the same form since it could never have been used due to the missing support in Sema. I couldn't find any documentation that this form existed either. Nor is there documentation for one of the remaining two forms, but there is a testcase that uses it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269879 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index 8f122963a1..0e49ce6aaf 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -984,8 +984,7 @@ Value *ScalarExprEmitter::VisitExpr(Expr *E) { Value *ScalarExprEmitter::VisitShuffleVectorExpr(ShuffleVectorExpr *E) { // Vector Mask Case - if (E->getNumSubExprs() == 2 || - (E->getNumSubExprs() == 3 && E->getExpr(2)->getType()->isVectorType())) { + if (E->getNumSubExprs() == 2) { Value *LHS = CGF.EmitScalarExpr(E->getExpr(0)); Value *RHS = CGF.EmitScalarExpr(E->getExpr(1)); Value *Mask; @@ -993,22 +992,7 @@ Value *ScalarExprEmitter::VisitShuffleVectorExpr(ShuffleVectorExpr *E) { llvm::VectorType *LTy = cast(LHS->getType()); unsigned LHSElts = LTy->getNumElements(); - if (E->getNumSubExprs() == 3) { - Mask = CGF.EmitScalarExpr(E->getExpr(2)); - - // Shuffle LHS & RHS into one input vector. - SmallVector concat; - for (unsigned i = 0; i != LHSElts; ++i) { - concat.push_back(Builder.getInt32(2*i)); - concat.push_back(Builder.getInt32(2*i+1)); - } - - Value* CV = llvm::ConstantVector::get(concat); - LHS = Builder.CreateShuffleVector(LHS, RHS, CV, "concat"); - LHSElts *= 2; - } else { - Mask = RHS; - } + Mask = RHS; llvm::VectorType *MTy = cast(Mask->getType()); diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index 31a20cb806..dc91b93f20 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -3136,8 +3136,7 @@ ExprResult Sema::SemaBuiltinShuffleVector(CallExpr *TheCall) { // Determine which of the following types of shufflevector we're checking: // 1) unary, vector mask: (lhs, mask) - // 2) binary, vector mask: (lhs, rhs, mask) - // 3) binary, scalar mask: (lhs, rhs, index, ..., index) + // 2) binary, scalar mask: (lhs, rhs, index, ..., index) QualType resType = TheCall->getArg(0)->getType(); unsigned numElements = 0;