r269879 - [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.
Craig Topper via cfe-commits
cfe-commits at lists.llvm.org
Tue May 17 21:11:26 PDT 2016
Author: ctopper
Date: Tue May 17 23:11:25 2016
New Revision: 269879
URL: http://llvm.org/viewvc/llvm-project?rev=269879&view=rev
Log:
[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.
Modified:
cfe/trunk/lib/CodeGen/CGExprScalar.cpp
cfe/trunk/lib/Sema/SemaChecking.cpp
Modified: cfe/trunk/lib/CodeGen/CGExprScalar.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprScalar.cpp?rev=269879&r1=269878&r2=269879&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprScalar.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprScalar.cpp Tue May 17 23:11:25 2016
@@ -984,8 +984,7 @@ Value *ScalarExprEmitter::VisitExpr(Expr
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::VisitShuffleVe
llvm::VectorType *LTy = cast<llvm::VectorType>(LHS->getType());
unsigned LHSElts = LTy->getNumElements();
- if (E->getNumSubExprs() == 3) {
- Mask = CGF.EmitScalarExpr(E->getExpr(2));
-
- // Shuffle LHS & RHS into one input vector.
- SmallVector<llvm::Constant*, 32> 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<llvm::VectorType>(Mask->getType());
Modified: cfe/trunk/lib/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=269879&r1=269878&r2=269879&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/lib/Sema/SemaChecking.cpp Tue May 17 23:11:25 2016
@@ -3136,8 +3136,7 @@ ExprResult Sema::SemaBuiltinShuffleVecto
// 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;
More information about the cfe-commits
mailing list