mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-31 09:25:42 +00:00
Add suppport for ConstantExprs of shufflevectors whose result type is not equal to the
type of the vectors being shuffled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64401 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -554,7 +554,10 @@ public:
|
||||
return User::operator new(s, 3);
|
||||
}
|
||||
ShuffleVectorConstantExpr(Constant *C1, Constant *C2, Constant *C3)
|
||||
: ConstantExpr(C1->getType(), Instruction::ShuffleVector,
|
||||
: ConstantExpr(VectorType::get(
|
||||
cast<VectorType>(C1->getType())->getElementType(),
|
||||
cast<VectorType>(C3->getType())->getNumElements()),
|
||||
Instruction::ShuffleVector,
|
||||
&Op<0>(), 3) {
|
||||
Op<0>() = C1;
|
||||
Op<1>() = C2;
|
||||
@@ -2349,7 +2352,11 @@ Constant *ConstantExpr::getShuffleVector(Constant *V1, Constant *V2,
|
||||
Constant *Mask) {
|
||||
assert(ShuffleVectorInst::isValidOperands(V1, V2, Mask) &&
|
||||
"Invalid shuffle vector constant expr operands!");
|
||||
return getShuffleVectorTy(V1->getType(), V1, V2, Mask);
|
||||
|
||||
unsigned NElts = cast<VectorType>(Mask->getType())->getNumElements();
|
||||
const Type *EltTy = cast<VectorType>(V1->getType())->getElementType();
|
||||
const Type *ShufTy = VectorType::get(EltTy, NElts);
|
||||
return getShuffleVectorTy(ShufTy, V1, V2, Mask);
|
||||
}
|
||||
|
||||
Constant *ConstantExpr::getInsertValueTy(const Type *ReqTy, Constant *Agg,
|
||||
|
Reference in New Issue
Block a user