Attached is a patch for PR1195 which changes the name of PackedType to VectorType. No other functional changes.
Reid.
Index: gcc/llvm-convert.cpp =================================================================== --- gcc/llvm-convert.cpp (revision 275) +++ gcc/llvm-convert.cpp (working copy) @@ -3231,17 +3231,17 @@ for (unsigned i = 0, e = Ops.size(); i != e && AllConstants; ++i) AllConstants &= isa<Constant>(Ops[i]); - // If this is a constant vector, create a ConstantPacked. + // If this is a constant vector, create a ConstantVector. if (AllConstants) { std::vector<Constant*> CstOps; for (unsigned i = 0, e = Ops.size(); i != e; ++i) CstOps.push_back(cast<Constant>(Ops[i])); - return ConstantPacked::get(CstOps); + return ConstantVector::get(CstOps); } // Otherwise, insertelement the values to build the vector. Value *Result = - UndefValue::get(PackedType::get(Ops[0]->getType(), Ops.size())); + UndefValue::get(VectorType::get(Ops[0]->getType(), Ops.size())); for (unsigned i = 0, e = Ops.size(); i != e; ++i) Result = new InsertElementInst(Result, Ops[i], @@ -3275,9 +3275,9 @@ /// Undef values may be specified by passing in -1 as the result value. /// Value *TreeToLLVM::BuildVectorShuffle(Value *InVec1, Value *InVec2, ...) { - assert(isa<PackedType>(InVec1->getType()) && + assert(isa<VectorType>(InVec1->getType()) && InVec1->getType() == InVec2->getType() && "Invalid shuffle!"); - unsigned NumElements = cast<PackedType>(InVec1->getType())->getNumElements(); + unsigned NumElements = cast<VectorType>(InVec1->getType())->getNumElements(); // Get all the indexes from varargs. std::vector<Constant*> Idxs; @@ -3295,7 +3295,7 @@ va_end(VA); // Turn this into the appropriate shuffle operation. - return new ShuffleVectorInst(InVec1, InVec2, ConstantPacked::get(Idxs), + return new ShuffleVectorInst(InVec1, InVec2, ConstantVector::get(Idxs), "tmp", CurBB); } @@ -4374,14 +4374,14 @@ Value *TreeToLLVM::EmitCONSTRUCTOR(tree exp, Value *DestLoc) { tree type = TREE_TYPE(exp); const Type *Ty = ConvertType(type); - if (const PackedType *PTy = dyn_cast<PackedType>(Ty)) { + if (const VectorType *PTy = dyn_cast<VectorType>(Ty)) { assert(DestLoc == 0 && "Dest location for packed value?"); std::vector<Value *> BuildVecOps; // Insert zero initializers for any uninitialized values. Constant *Zero = Constant::getNullValue(PTy->getElementType()); - BuildVecOps.resize(cast<PackedType>(Ty)->getNumElements(), Zero); + BuildVecOps.resize(cast<VectorType>(Ty)->getNumElements(), Zero); // Insert all of the elements here. for (tree Ops = TREE_OPERAND(exp, 0); Ops; Ops = TREE_CHAIN(Ops)) { @@ -4519,7 +4519,7 @@ for (tree elt = TREE_VECTOR_CST_ELTS(exp); elt; elt = TREE_CHAIN(elt)) Elts.push_back(Convert(TREE_VALUE(elt))); - return ConstantPacked::get(Elts); + return ConstantVector::get(Elts); } Constant *TreeConstantToLLVM::ConvertSTRING_CST(tree exp) { Index: gcc/llvm-types.cpp =================================================================== --- gcc/llvm-types.cpp (revision 275) +++ gcc/llvm-types.cpp (working copy) @@ -334,7 +334,7 @@ if (const Type *Ty = GET_TYPE_LLVM(type)) return Ty; const Type *Ty = ConvertType(TREE_TYPE(type)); assert(!Ty->isAbstract() && "should use TypeDB.setType()"); - Ty = PackedType::get(Ty, TYPE_VECTOR_SUBPARTS(type)); + Ty = VectorType::get(Ty, TYPE_VECTOR_SUBPARTS(type)); return SET_TYPE_LLVM(type, Ty); } Index: gcc/config/i386/llvm-i386.cpp =================================================================== --- gcc/config/i386/llvm-i386.cpp (revision 275) +++ gcc/config/i386/llvm-i386.cpp (working copy) @@ -81,8 +81,8 @@ Result = BinaryOperator::createMul(Ops[0], Ops[1], "tmp", CurBB); return true; case IX86_BUILTIN_PSLLWI128: { - PackedType *v4i32 = PackedType::get(Type::Int32Ty, 4); - PackedType *v8i16 = PackedType::get(Type::Int16Ty, 8); + VectorType *v4i32 = VectorType::get(Type::Int32Ty, 4); + VectorType *v8i16 = VectorType::get(Type::Int16Ty, 8); static Constant *psllw = 0; if (psllw == 0) { Module *M = CurBB->getParent()->getParent(); @@ -97,7 +97,7 @@ return true; } case IX86_BUILTIN_PSLLDI128: { - PackedType *v4i32 = PackedType::get(Type::Int32Ty, 4); + VectorType *v4i32 = VectorType::get(Type::Int32Ty, 4); static Constant *pslld = 0; if (pslld == 0) { Module *M = CurBB->getParent()->getParent(); @@ -112,8 +112,8 @@ return true; } case IX86_BUILTIN_PSLLQI128: { - PackedType *v4i32 = PackedType::get(Type::Int32Ty, 4); - PackedType *v2i64 = PackedType::get(Type::Int64Ty, 2); + VectorType *v4i32 = VectorType::get(Type::Int32Ty, 4); + VectorType *v2i64 = VectorType::get(Type::Int64Ty, 2); static Constant *psllq = 0; if (psllq == 0) { Module *M = CurBB->getParent()->getParent(); @@ -128,8 +128,8 @@ return true; } case IX86_BUILTIN_PSRLWI128: { - PackedType *v4i32 = PackedType::get(Type::Int32Ty, 4); - PackedType *v8i16 = PackedType::get(Type::Int16Ty, 8); + VectorType *v4i32 = VectorType::get(Type::Int32Ty, 4); + VectorType *v8i16 = VectorType::get(Type::Int16Ty, 8); static Constant *psrlw = 0; if (psrlw == 0) { Module *M = CurBB->getParent()->getParent(); @@ -144,7 +144,7 @@ return true; } case IX86_BUILTIN_PSRLDI128: { - PackedType *v4i32 = PackedType::get(Type::Int32Ty, 4); + VectorType *v4i32 = VectorType::get(Type::Int32Ty, 4); static Constant *psrld = 0; if (psrld == 0) { Module *M = CurBB->getParent()->getParent(); @@ -159,8 +159,8 @@ return true; } case IX86_BUILTIN_PSRLQI128: { - PackedType *v4i32 = PackedType::get(Type::Int32Ty, 4); - PackedType *v2i64 = PackedType::get(Type::Int64Ty, 2); + VectorType *v4i32 = VectorType::get(Type::Int32Ty, 4); + VectorType *v2i64 = VectorType::get(Type::Int64Ty, 2); static Constant *psrlq = 0; if (psrlq == 0) { Module *M = CurBB->getParent()->getParent(); @@ -175,8 +175,8 @@ return true; } case IX86_BUILTIN_PSRAWI128: { - PackedType *v4i32 = PackedType::get(Type::Int32Ty, 4); - PackedType *v8i16 = PackedType::get(Type::Int16Ty, 8); + VectorType *v4i32 = VectorType::get(Type::Int32Ty, 4); + VectorType *v8i16 = VectorType::get(Type::Int16Ty, 8); static Constant *psraw = 0; if (psraw == 0) { Module *M = CurBB->getParent()->getParent(); @@ -191,7 +191,7 @@ return true; } case IX86_BUILTIN_PSRADI128: { - PackedType *v4i32 = PackedType::get(Type::Int32Ty, 4); + VectorType *v4i32 = VectorType::get(Type::Int32Ty, 4); static Constant *psrad = 0; if (psrad == 0) { Module *M = CurBB->getParent()->getParent(); @@ -226,7 +226,7 @@ case IX86_BUILTIN_ORPS: case IX86_BUILTIN_XORPS: case IX86_BUILTIN_ANDNPS: { - PackedType *v4i32 = PackedType::get(Type::Int32Ty, 4); + VectorType *v4i32 = VectorType::get(Type::Int32Ty, 4); Ops[0] = new BitCastInst(Ops[0], v4i32, "tmp", CurBB); Ops[1] = new BitCastInst(Ops[1], v4i32, "tmp", CurBB); switch (FnCode) { @@ -252,7 +252,7 @@ case IX86_BUILTIN_ORPD: case IX86_BUILTIN_XORPD: case IX86_BUILTIN_ANDNPD: { - PackedType *v2i64 = PackedType::get(Type::Int64Ty, 2); + VectorType *v2i64 = VectorType::get(Type::Int64Ty, 2); Ops[0] = new BitCastInst(Ops[0], v2i64, "tmp", CurBB); Ops[1] = new BitCastInst(Ops[1], v2i64, "tmp", CurBB); switch (FnCode) { @@ -389,7 +389,7 @@ return true; } case IX86_BUILTIN_STOREHPS: { - PackedType *v2f64 = PackedType::get(Type::DoubleTy, 2); + VectorType *v2f64 = VectorType::get(Type::DoubleTy, 2); PointerType *f64Ptr = PointerType::get(Type::DoubleTy); Ops[0] = new BitCastInst(Ops[0], f64Ptr, "tmp", CurBB); Value *Idx = ConstantInt::get(Type::Int32Ty, 1); @@ -399,7 +399,7 @@ return true; } case IX86_BUILTIN_STORELPS: { - PackedType *v2f64 = PackedType::get(Type::DoubleTy, 2); + VectorType *v2f64 = VectorType::get(Type::DoubleTy, 2); PointerType *f64Ptr = PointerType::get(Type::DoubleTy); Ops[0] = new BitCastInst(Ops[0], f64Ptr, "tmp", CurBB); Value *Idx = ConstantInt::get(Type::Int32Ty, 0); @@ -447,7 +447,7 @@ case IX86_BUILTIN_CMPNGEPS: case IX86_BUILTIN_CMPORDPS: case IX86_BUILTIN_CMPUNORDPS: { - PackedType *v4f32 = PackedType::get(Type::FloatTy, 4); + VectorType *v4f32 = VectorType::get(Type::FloatTy, 4); static Constant *cmpps = 0; if (cmpps == 0) { Module *M = CurBB->getParent()->getParent(); @@ -517,7 +517,7 @@ case IX86_BUILTIN_CMPNGESS: case IX86_BUILTIN_CMPORDSS: case IX86_BUILTIN_CMPUNORDSS: { - PackedType *v4f32 = PackedType::get(Type::FloatTy, 4); + VectorType *v4f32 = VectorType::get(Type::FloatTy, 4); static Constant *cmpss = 0; if (cmpss == 0) { Module *M = CurBB->getParent()->getParent(); @@ -572,7 +572,7 @@ case IX86_BUILTIN_CMPNGEPD: case IX86_BUILTIN_CMPORDPD: case IX86_BUILTIN_CMPUNORDPD: { - PackedType *v2f64 = PackedType::get(Type::DoubleTy, 2); + VectorType *v2f64 = VectorType::get(Type::DoubleTy, 2); static Constant *cmpps = 0; if (cmpps == 0) { Module *M = CurBB->getParent()->getParent(); @@ -641,7 +641,7 @@ case IX86_BUILTIN_CMPNLESD: case IX86_BUILTIN_CMPORDSD: case IX86_BUILTIN_CMPUNORDSD: { - PackedType *v2f64 = PackedType::get(Type::DoubleTy, 2); + VectorType *v2f64 = VectorType::get(Type::DoubleTy, 2); static Constant *cmpss = 0; if (cmpss == 0) { Module *M = CurBB->getParent()->getParent(); Index: gcc/config/rs6000/llvm-rs6000.cpp =================================================================== --- gcc/config/rs6000/llvm-rs6000.cpp (revision 275) +++ gcc/config/rs6000/llvm-rs6000.cpp (working copy) @@ -279,7 +279,7 @@ if (ConstantInt *Elt = dyn_cast<ConstantInt>(Ops[2])) { /* Map all of these to a shuffle. */ unsigned Amt = Elt->getZExtValue() & 15; - PackedType *v16i8 = PackedType::get(Type::Int8Ty, 16); + VectorType *v16i8 = VectorType::get(Type::Int8Ty, 16); Value *Op0 = Ops[0]; Instruction::CastOps opc = CastInst::getCastOpcode(Op0, IntrinsicOpIsSigned(Args,0), ResultType, false); @@ -345,10 +345,10 @@ return true; case ALTIVEC_BUILTIN_ABS_V4SF: { /* and out sign bits */ - PackedType *v4i32 = PackedType::get(Type::Int32Ty, 4); + VectorType *v4i32 = VectorType::get(Type::Int32Ty, 4); Ops[0] = new BitCastInst(Ops[0], v4i32, Ops[0]->getName(),CurBB); Constant *C = ConstantInt::get(Type::Int32Ty, 0x7FFFFFFF); - C = ConstantPacked::get(std::vector<Constant*>(4, C)); + C = ConstantVector::get(std::vector<Constant*>(4, C)); Result = BinaryOperator::createAnd(Ops[0], C, "tmp", CurBB); TargetIntrinsicCastResult(Result, ResultType, ResIsSigned, ExpIsSigned, CurBB); @@ -360,7 +360,7 @@ Result = BinaryOperator::createNeg(Ops[0], "tmp", CurBB); /* get the right smax intrinsic. */ static Constant *smax[3]; - const PackedType *PTy = cast<PackedType>(ResultType); + const VectorType *PTy = cast<VectorType>(ResultType); unsigned N = GetAltivecTypeNumFromType(PTy->getElementType()); if (smax[N] == 0) { Module *M = CurBB->getParent()->getParent(); @@ -376,7 +376,7 @@ case ALTIVEC_BUILTIN_ABSS_V16QI: { /* iabss(x) -> smax(x, satsub(0,x)) */ static Constant *sxs[3], *smax[3]; /* get the right satsub intrinsic. */ - const PackedType *PTy = cast<PackedType>(ResultType); + const VectorType *PTy = cast<VectorType>(ResultType); unsigned N = GetAltivecTypeNumFromType(PTy->getElementType()); if (sxs[N] == 0) { Module *M = CurBB->getParent()->getParent();
_______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits