forked from OSchip/llvm-project
[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. llvm-svn: 269879
This commit is contained in:
parent
39c871038a
commit
b3174a84b3
|
@ -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<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());
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue