Attached is the llvm-gcc4 patch to correspond with the new CAST instructions in LLVM.
For Review Only. PLEASE DO NOT COMMIT THIS! Reid.
Index: gcc/llvm-convert.cpp =================================================================== --- gcc/llvm-convert.cpp (revision 204) +++ gcc/llvm-convert.cpp (working copy) @@ -147,6 +147,11 @@ } namespace { + /// GetCast - This helper function is used to get the correct kind of a + /// cast given a tree expression + ConvertInst* GetCast(Value* V, const Type* Ty, tree expr) { + } + /// FunctionPrologArgumentConversion - This helper class is driven by the ABI /// definition for this target to figure out how to retrieve arguments from /// the stack/regs coming into a function and store them into an appropriate @@ -213,12 +218,12 @@ // the actual impls is a short or char. assert(ArgVal->getType()->isIntegral() && LLVMTy->isIntegral() && "Lowerings don't match?"); - ArgVal = new CastInst(ArgVal, LLVMTy, NameStack.back(), CurBB); + ArgVal = ConvertInst::getCast(ArgVal, LLVMTy, NameStack.back(), CurBB); } assert(!LocStack.empty()); Value *Loc = LocStack.back(); if (cast<PointerType>(Loc->getType())->getElementType() != LLVMTy) - Loc = new CastInst(Loc, PointerType::get(LLVMTy), "tmp", CurBB); + Loc = ConvertInst::getCast(Loc, PointerType::get(LLVMTy), "tmp", CurBB); new StoreInst(ArgVal, Loc, CurBB); AI->setName(NameStack.back()); @@ -232,7 +237,8 @@ Constant *FIdx = ConstantInt::get(Type::UIntTy, FieldNo); Value *Loc = LocStack.back(); if (cast<PointerType>(Loc->getType())->getElementType() != StructTy) - Loc = new CastInst(Loc, PointerType::get(StructTy), "tmp", CurBB); + Loc = ConvertInst::getCast(Loc, PointerType::get(StructTy), "tmp", + CurBB); Loc = new GetElementPtrInst(Loc, Zero, FIdx, "tmp", CurBB); LocStack.push_back(Loc); } @@ -658,10 +664,10 @@ // Handle cast (cast bool X to T2) to bool as X, because this occurs all over // the place. - if (CastInst *CI = dyn_cast<CastInst>(V)) + if (ConvertInst *CI = dyn_cast<ConvertInst>(V)) if (Ty == Type::BoolTy && CI->getOperand(0)->getType() == Type::BoolTy) return CI->getOperand(0); - return new CastInst(V, Ty, V->getName(), CurBB); + return ConvertInst::getCast(V, Ty, V->getName(), CurBB); } /// isNoopCast - Return true if a cast from V to Ty does not change any bits. @@ -694,8 +700,9 @@ // alloc instructions before. It doesn't matter what this instruction is, // it is dead. This allows us to insert allocas in order without having to // scan for an insertion point. - AllocaInsertionPoint = new CastInst(Constant::getNullValue(Type::IntTy), - Type::IntTy, "alloca point"); + AllocaInsertionPoint = + ConvertInst::getCast(Constant::getNullValue(Type::IntTy), Type::IntTy, + "alloca point"); // Insert it as the first instruction in the entry block. Fn->begin()->getInstList().insert(Fn->begin()->begin(), AllocaInsertionPoint); @@ -1858,7 +1865,7 @@ assert(!LocStack.empty()); Value *Loc = LocStack.back(); if (cast<PointerType>(Loc->getType())->getElementType() != LLVMTy) - Loc = new CastInst(Loc, PointerType::get(LLVMTy), "tmp", CurBB); + Loc = ConvertInst::getCast(Loc, PointerType::get(LLVMTy), "tmp", CurBB); Value *V = new LoadInst(Loc, "tmp", CurBB); CallOperands.push_back(V); @@ -1869,7 +1876,8 @@ Constant *FIdx = ConstantInt::get(Type::UIntTy, FieldNo); Value *Loc = LocStack.back(); if (cast<PointerType>(Loc->getType())->getElementType() != StructTy) - Loc = new CastInst(Loc, PointerType::get(StructTy), "tmp", CurBB); + Loc = ConvertInst::getCast(Loc, PointerType::get(StructTy), "tmp", + CurBB); Loc = new GetElementPtrInst(Loc, Zero, FIdx, "tmp", CurBB); LocStack.push_back(Loc); @@ -3754,7 +3762,8 @@ TREE_CODE(TYPE_MAX_VALUE(Domain)) != INTEGER_CST) { // Make sure that ArrayAddr is of type ElementTy*, then do a 2-index gep. tree ElTy = TREE_TYPE(TREE_TYPE(Array)); - ArrayAddr = new CastInst(ArrayAddr, PointerType::get(ConvertType(ElTy)), + ArrayAddr = + ConvertInst::getCast(ArrayAddr, PointerType::get(ConvertType(ElTy)), "tmp", CurBB); return new GetElementPtrInst(ArrayAddr, IndexVal, "tmp", CurBB); } Index: gcc/llvm-debug.cpp =================================================================== --- gcc/llvm-debug.cpp (revision 204) +++ gcc/llvm-debug.cpp (working copy) @@ -358,7 +358,7 @@ Variable->setType(TyDesc); // Call llvm.dbg.declare. - Value *AllocACast = new CastInst(AI, EmpPtr, Name, CurBB); + Value *AllocACast = ConvertInst::getCast(AI, EmpPtr, Name, CurBB); new CallInst(DeclareFn, AllocACast, getCastValueFor(Variable), "", CurBB); } Index: gcc/config/i386/i386.h =================================================================== --- gcc/config/i386/i386.h (revision 204) +++ gcc/config/i386/i386.h (working copy) @@ -4088,7 +4088,7 @@ Value *Undef = UndefValue::get(Type::IntTy); \ OPS[1] = BuildVector(OPS[1], Undef, Undef, Undef, NULL); \ RESULT = new CallInst(psllw, OPS[0], OPS[1], "tmp", CurBB); \ - RESULT = new CastInst(RESULT, DESTTY, "tmp", CurBB); \ + RESULT = ConvertInst::getCast(RESULT, DESTTY, "tmp", CurBB); \ return true; \ } \ case IX86_BUILTIN_PSLLDI128: { \ @@ -4102,7 +4102,7 @@ Value *Undef = UndefValue::get(Type::IntTy); \ OPS[1] = BuildVector(OPS[1], Undef, Undef, Undef, NULL); \ RESULT = new CallInst(pslld, OPS[0], OPS[1], "tmp", CurBB); \ - RESULT = new CastInst(RESULT, DESTTY, "tmp", CurBB); \ + RESULT = ConvertInst::getCast(RESULT, DESTTY, "tmp", CurBB); \ return true; \ } \ case IX86_BUILTIN_PSLLQI128: { \ @@ -4117,7 +4117,7 @@ Value *Undef = UndefValue::get(Type::IntTy); \ OPS[1] = BuildVector(OPS[1], Undef, Undef, Undef, NULL); \ RESULT = new CallInst(psllq, OPS[0], OPS[1], "tmp", CurBB); \ - RESULT = new CastInst(RESULT, DESTTY, "tmp", CurBB); \ + RESULT = ConvertInst::getCast(RESULT, DESTTY, "tmp", CurBB); \ return true; \ } \ case IX86_BUILTIN_PSRLWI128: { \ @@ -4132,7 +4132,7 @@ Value *Undef = UndefValue::get(Type::IntTy); \ OPS[1] = BuildVector(OPS[1], Undef, Undef, Undef, NULL); \ RESULT = new CallInst(psrlw, OPS[0], OPS[1], "tmp", CurBB); \ - RESULT = new CastInst(RESULT, DESTTY, "tmp", CurBB); \ + RESULT = ConvertInst::getCast(RESULT, DESTTY, "tmp", CurBB); \ return true; \ } \ case IX86_BUILTIN_PSRLDI128: { \ @@ -4146,7 +4146,7 @@ Value *Undef = UndefValue::get(Type::IntTy); \ OPS[1] = BuildVector(OPS[1], Undef, Undef, Undef, NULL); \ RESULT = new CallInst(psrld, OPS[0], OPS[1], "tmp", CurBB); \ - RESULT = new CastInst(RESULT, DESTTY, "tmp", CurBB); \ + RESULT = ConvertInst::getCast(RESULT, DESTTY, "tmp", CurBB); \ return true; \ } \ case IX86_BUILTIN_PSRLQI128: { \ @@ -4161,7 +4161,7 @@ Value *Undef = UndefValue::get(Type::IntTy); \ OPS[1] = BuildVector(OPS[1], Undef, Undef, Undef, NULL); \ RESULT = new CallInst(psrlq, OPS[0], OPS[1], "tmp", CurBB); \ - RESULT = new CastInst(RESULT, DESTTY, "tmp", CurBB); \ + RESULT = ConvertInst::getCast(RESULT, DESTTY, "tmp", CurBB); \ return true; \ } \ case IX86_BUILTIN_PSRAWI128: { \ @@ -4176,7 +4176,7 @@ Value *Undef = UndefValue::get(Type::IntTy); \ OPS[1] = BuildVector(OPS[1], Undef, Undef, Undef, NULL); \ RESULT = new CallInst(psraw, OPS[0], OPS[1], "tmp", CurBB); \ - RESULT = new CastInst(RESULT, DESTTY, "tmp", CurBB); \ + RESULT = ConvertInst::getCast(RESULT, DESTTY, "tmp", CurBB); \ return true; \ } \ case IX86_BUILTIN_PSRADI128: { \ @@ -4190,12 +4190,12 @@ Value *Undef = UndefValue::get(Type::IntTy); \ OPS[1] = BuildVector(OPS[1], Undef, Undef, Undef, NULL); \ RESULT = new CallInst(psrad, OPS[0], OPS[1], "tmp", CurBB); \ - RESULT = new CastInst(RESULT, DESTTY, "tmp", CurBB); \ + RESULT = ConvertInst::getCast(RESULT, DESTTY, "tmp", CurBB); \ return true; \ } \ case IX86_BUILTIN_DIVPS: \ case IX86_BUILTIN_DIVPD: \ - RESULT = BinaryOperator::createFDiv(OPS[0], OPS[1], "tmp", CURBB); \ + RESULT = BinaryOperator::createFDiv(OPS[0], OPS[1], "tmp", CURBB); \ return true; \ case IX86_BUILTIN_PAND128: \ RESULT = BinaryOperator::createAnd(OPS[0], OPS[1], "tmp", CURBB); \ @@ -4215,8 +4215,8 @@ case IX86_BUILTIN_XORPS: \ case IX86_BUILTIN_ANDNPS: { \ PackedType *v4i32 = PackedType::get(Type::IntTy, 4); \ - OPS[0] = new CastInst(OPS[0], v4i32, "tmp", CurBB); \ - OPS[1] = new CastInst(OPS[1], v4i32, "tmp", CurBB); \ + OPS[0] = ConvertInst::getCast(OPS[0], v4i32, "tmp", CurBB); \ + OPS[1] = ConvertInst::getCast(OPS[1], v4i32, "tmp", CurBB); \ switch (BUILTIN_CODE) { \ case IX86_BUILTIN_ANDPS: \ RESULT = BinaryOperator::createAnd(OPS[0], OPS[1], "tmp", CURBB); \ @@ -4232,7 +4232,7 @@ RESULT = BinaryOperator::createAnd(OPS[0], OPS[1], "tmp", CURBB); \ break; \ } \ - RESULT = new CastInst(RESULT, DESTTY, "tmp", CurBB); \ + RESULT = ConvertInst::getCast(RESULT, DESTTY, "tmp", CurBB); \ return true; \ } \ case IX86_BUILTIN_ANDPD: \ @@ -4240,8 +4240,8 @@ case IX86_BUILTIN_XORPD: \ case IX86_BUILTIN_ANDNPD: { \ PackedType *v2i64 = PackedType::get(Type::LongTy, 2); \ - OPS[0] = new CastInst(OPS[0], v2i64, "tmp", CurBB); \ - OPS[1] = new CastInst(OPS[1], v2i64, "tmp", CurBB); \ + OPS[0] = ConvertInst::getCast(OPS[0], v2i64, "tmp", CurBB); \ + OPS[1] = ConvertInst::getCast(OPS[1], v2i64, "tmp", CurBB); \ switch (BUILTIN_CODE) { \ case IX86_BUILTIN_ANDPD: \ RESULT = BinaryOperator::createAnd(OPS[0], OPS[1], "tmp", CURBB); \ @@ -4257,7 +4257,7 @@ RESULT = BinaryOperator::createAnd(OPS[0], OPS[1], "tmp", CURBB); \ break; \ } \ - RESULT = new CastInst(RESULT, DESTTY, "tmp", CurBB); \ + RESULT = ConvertInst::getCast(RESULT, DESTTY, "tmp", CurBB); \ return true; \ } \ case IX86_BUILTIN_SHUFPS: \ @@ -4342,38 +4342,38 @@ PointerType *f64Ptr = PointerType::get(Type::DoubleTy); \ Value *Idx0 = ConstantInt::get(Type::UIntTy, 0); \ Value *Zero = ConstantFP::get(Type::DoubleTy, 0.0); \ - OPS[0] = new CastInst(OPS[0], f64Ptr, "tmp", CurBB); \ + OPS[0] = ConvertInst::getCast(OPS[0], f64Ptr, "tmp", CurBB); \ OPS[0] = new LoadInst(OPS[0], "tmp", false, CurBB); \ RESULT = BuildVector(OPS[0], Zero, NULL); \ - RESULT = new CastInst(RESULT, DESTTY, "tmp", CurBB); \ + RESULT = ConvertInst::getCast(RESULT, DESTTY, "tmp", CurBB); \ return true; \ } \ case IX86_BUILTIN_LOADHPS: { \ PointerType *f64Ptr = PointerType::get(Type::DoubleTy); \ - OPS[1] = new CastInst(OPS[1], f64Ptr, "tmp", CurBB); \ + OPS[1] = ConvertInst::getCast(OPS[1], f64Ptr, "tmp", CurBB); \ Value *Load = new LoadInst(OPS[1], "tmp", false, CurBB); \ OPS[1] = BuildVector(Load, UndefValue::get(Type::DoubleTy), NULL); \ - OPS[1] = new CastInst(OPS[1], DESTTY, "tmp", CurBB); \ + OPS[1] = ConvertInst::getCast(OPS[1], DESTTY, "tmp", CurBB); \ RESULT = BuildVectorShuffle(OPS[0], OPS[1], 0, 1, 4, 5); \ - RESULT = new CastInst(RESULT, DESTTY, "tmp", CurBB); \ + RESULT = ConvertInst::getCast(RESULT, DESTTY, "tmp", CurBB); \ return true; \ } \ case IX86_BUILTIN_LOADLPS: { \ PointerType *f64Ptr = PointerType::get(Type::DoubleTy); \ - OPS[1] = new CastInst(OPS[1], f64Ptr, "tmp", CurBB); \ + OPS[1] = ConvertInst::getCast(OPS[1], f64Ptr, "tmp", CurBB); \ Value *Load = new LoadInst(OPS[1], "tmp", false, CurBB); \ OPS[1] = BuildVector(Load, UndefValue::get(Type::DoubleTy), NULL); \ - OPS[1] = new CastInst(OPS[1], DESTTY, "tmp", CurBB); \ + OPS[1] = ConvertInst::getCast(OPS[1], DESTTY, "tmp", CurBB); \ RESULT = BuildVectorShuffle(OPS[0], OPS[1], 4, 5, 2, 3); \ - RESULT = new CastInst(RESULT, DESTTY, "tmp", CurBB); \ + RESULT = ConvertInst::getCast(RESULT, DESTTY, "tmp", CurBB); \ return true; \ } \ case IX86_BUILTIN_STOREHPS: { \ PackedType *v2f64 = PackedType::get(Type::DoubleTy, 2); \ PointerType *f64Ptr = PointerType::get(Type::DoubleTy); \ - OPS[0] = new CastInst(OPS[0], f64Ptr, "tmp", CurBB); \ + OPS[0] = ConvertInst::getCast(OPS[0], f64Ptr, "tmp", CurBB); \ Value *Idx = ConstantInt::get(Type::UIntTy, 1); \ - OPS[1] = new CastInst(OPS[1], v2f64, "tmp", CurBB); \ + OPS[1] = ConvertInst::getCast(OPS[1], v2f64, "tmp", CurBB); \ OPS[1] = new ExtractElementInst(OPS[1], Idx, "tmp", CurBB); \ RESULT = new StoreInst(OPS[1], OPS[0], false, CurBB); \ return true; \ @@ -4381,9 +4381,9 @@ case IX86_BUILTIN_STORELPS: { \ PackedType *v2f64 = PackedType::get(Type::DoubleTy, 2); \ PointerType *f64Ptr = PointerType::get(Type::DoubleTy); \ - OPS[0] = new CastInst(OPS[0], f64Ptr, "tmp", CurBB); \ + OPS[0] = ConvertInst::getCast(OPS[0], f64Ptr, "tmp", CurBB); \ Value *Idx = ConstantInt::get(Type::UIntTy, 0); \ - OPS[1] = new CastInst(OPS[1], v2f64, "tmp", CurBB); \ + OPS[1] = ConvertInst::getCast(OPS[1], v2f64, "tmp", CurBB); \ OPS[1] = new ExtractElementInst(OPS[1], Idx, "tmp", CurBB); \ RESULT = new StoreInst(OPS[1], OPS[0], false, CurBB); \ return true; \ @@ -4398,13 +4398,13 @@ case IX86_BUILTIN_VEC_EXT_V4SI: \ case IX86_BUILTIN_VEC_EXT_V4SF: \ case IX86_BUILTIN_VEC_EXT_V8HI: \ - OPS[1] = new CastInst(OPS[1], Type::UIntTy, "tmp", CurBB); \ + OPS[1] = ConvertInst::getCast(OPS[1], Type::UIntTy, "tmp", CurBB); \ RESULT = new ExtractElementInst(OPS[0], OPS[1], "tmp", CurBB); \ - RESULT = new CastInst(RESULT, DESTTY, "tmp", CurBB); \ + RESULT = ConvertInst::getCast(RESULT, DESTTY, "tmp", CurBB); \ return true; \ case IX86_BUILTIN_VEC_SET_V8HI: \ - OPS[1] = new CastInst(OPS[1], Type::ShortTy, "tmp", CurBB); \ - OPS[2] = new CastInst(OPS[2], Type::UIntTy, "tmp", CurBB); \ + OPS[1] = ConvertInst::getCast(OPS[1], Type::ShortTy, "tmp", CurBB); \ + OPS[2] = ConvertInst::getCast(OPS[2], Type::UIntTy, "tmp", CurBB); \ RESULT = new InsertElementInst(OPS[0], OPS[1], OPS[2], "tmp", CurBB); \ return true; \ case IX86_BUILTIN_CMPEQPS: \ @@ -4472,15 +4472,15 @@ } \ std::vector<Value*> Ops; \ if (flip) { \ - Ops.push_back(new CastInst(OPS[1], v4f32, "tmp", CurBB)); \ - Ops.push_back(new CastInst(OPS[0], v4f32, "tmp", CurBB)); \ + Ops.push_back(ConvertInst::getCast(OPS[1], v4f32, "tmp", CurBB)); \ + Ops.push_back(ConvertInst::getCast(OPS[0], v4f32, "tmp", CurBB)); \ } else { \ - Ops.push_back(new CastInst(OPS[0], v4f32, "tmp", CurBB)); \ - Ops.push_back(new CastInst(OPS[1], v4f32, "tmp", CurBB)); \ + Ops.push_back(ConvertInst::getCast(OPS[0], v4f32, "tmp", CurBB)); \ + Ops.push_back(ConvertInst::getCast(OPS[1], v4f32, "tmp", CurBB)); \ } \ Ops.push_back(Pred); \ RESULT = new CallInst(cmpps, Ops, "tmp", CurBB); \ - RESULT = new CastInst(RESULT, DESTTY, "tmp", CurBB); \ + RESULT = ConvertInst::getCast(RESULT, DESTTY, "tmp", CurBB); \ return true; \ } \ case IX86_BUILTIN_CMPEQSS: \ @@ -4528,11 +4528,11 @@ break; \ } \ std::vector<Value*> Ops; \ - Ops.push_back(new CastInst(OPS[0], v4f32, "tmp", CurBB)); \ - Ops.push_back(new CastInst(OPS[1], v4f32, "tmp", CurBB)); \ + Ops.push_back(ConvertInst::getCast(OPS[0], v4f32, "tmp", CurBB)); \ + Ops.push_back(ConvertInst::getCast(OPS[1], v4f32, "tmp", CurBB)); \ Ops.push_back(Pred); \ RESULT = new CallInst(cmpss, Ops, "tmp", CurBB); \ - RESULT = new CastInst(RESULT, DESTTY, "tmp", CurBB); \ + RESULT = ConvertInst::getCast(RESULT, DESTTY, "tmp", CurBB); \ return true; \ } \ case IX86_BUILTIN_CMPEQPD: \ @@ -4600,15 +4600,15 @@ } \ std::vector<Value*> Ops; \ if (flip) { \ - Ops.push_back(new CastInst(OPS[1], v2f64, "tmp", CurBB)); \ - Ops.push_back(new CastInst(OPS[0], v2f64, "tmp", CurBB)); \ + Ops.push_back(ConvertInst::getCast(OPS[1], v2f64, "tmp", CurBB)); \ + Ops.push_back(ConvertInst::getCast(OPS[0], v2f64, "tmp", CurBB)); \ } else { \ - Ops.push_back(new CastInst(OPS[0], v2f64, "tmp", CurBB)); \ - Ops.push_back(new CastInst(OPS[1], v2f64, "tmp", CurBB)); \ + Ops.push_back(ConvertInst::getCast(OPS[0], v2f64, "tmp", CurBB)); \ + Ops.push_back(ConvertInst::getCast(OPS[1], v2f64, "tmp", CurBB)); \ } \ Ops.push_back(Pred); \ RESULT = new CallInst(cmpps, Ops, "tmp", CurBB); \ - RESULT = new CastInst(RESULT, DESTTY, "tmp", CurBB); \ + RESULT = ConvertInst::getCast(RESULT, DESTTY, "tmp", CurBB); \ return true; \ } \ case IX86_BUILTIN_CMPEQSD: \ @@ -4654,11 +4654,11 @@ break; \ } \ std::vector<Value*> Ops; \ - Ops.push_back(new CastInst(OPS[0], v2f64, "tmp", CurBB)); \ - Ops.push_back(new CastInst(OPS[1], v2f64, "tmp", CurBB)); \ + Ops.push_back(ConvertInst::getCast(OPS[0], v2f64, "tmp", CurBB)); \ + Ops.push_back(ConvertInst::getCast(OPS[1], v2f64, "tmp", CurBB)); \ Ops.push_back(Pred); \ RESULT = new CallInst(cmpss, Ops, "tmp", CurBB); \ - RESULT = new CastInst(RESULT, DESTTY, "tmp", CurBB); \ + RESULT = ConvertInst::getCast(RESULT, DESTTY, "tmp", CurBB); \ return true; \ } \ case IX86_BUILTIN_LDMXCSR: { \ Index: gcc/config/rs6000/rs6000.h =================================================================== --- gcc/config/rs6000/rs6000.h (revision 204) +++ gcc/config/rs6000/rs6000.h (working copy) @@ -3854,14 +3854,14 @@ } \ return false; \ case ALTIVEC_BUILTIN_VPKUHUM: \ - OPS[0] = new CastInst(OPS[0], DESTTY, OPS[0]->getName(), CurBB); \ - OPS[1] = new CastInst(OPS[1], DESTTY, OPS[0]->getName(), CurBB); \ + OPS[0] = ConvertInst::getCast(OPS[0], DESTTY, OPS[0]->getName(), CurBB); \ + OPS[1] = ConvertInst::getCast(OPS[1], DESTTY, OPS[0]->getName(), CurBB); \ RESULT = BuildVectorShuffle(OPS[0], OPS[1], 1, 3, 5, 7, 9, 11, 13, 15, \ 17, 19, 21, 23, 25, 27, 29, 31); \ return true; \ case ALTIVEC_BUILTIN_VPKUWUM: \ - OPS[0] = new CastInst(OPS[0], DESTTY, OPS[0]->getName(), CurBB); \ - OPS[1] = new CastInst(OPS[1], DESTTY, OPS[0]->getName(), CurBB); \ + OPS[0] = ConvertInst::getCast(OPS[0], DESTTY, OPS[0]->getName(), CurBB); \ + OPS[1] = ConvertInst::getCast(OPS[1], DESTTY, OPS[0]->getName(), CurBB); \ RESULT = BuildVectorShuffle(OPS[0], OPS[1], 1, 3, 5, 7, 9, 11, 13, 15); \ return true; \ case ALTIVEC_BUILTIN_VMRGHB: \ @@ -3889,11 +3889,11 @@ case ALTIVEC_BUILTIN_ABS_V4SF: { \ /* and out sign bits */ \ PackedType *v4i32 = PackedType::get(Type::IntTy, 4); \ - OPS[0] = new CastInst(OPS[0], v4i32, OPS[0]->getName(), CurBB); \ - Constant *C = ConstantInt::get(Type::IntTy, 0x7FFFFFFF); \ + OPS[0] = ConvertInst::getCast(OPS[0], v4i32, OPS[0]->getName(), CurBB); \ + Constant *C = ConstantInt::get(Type::IntTy, 0x7FFFFFFF); \ C = ConstantPacked::get(std::vector<Constant*>(4, C)); \ RESULT = BinaryOperator::createAnd(OPS[0], C, "tmp", CurBB); \ - RESULT = new CastInst(RESULT, DESTTY, "tmp", CurBB); \ + RESULT = ConvertInst::getCast(RESULT, DESTTY, "tmp", CurBB); \ return true; \ } \ case ALTIVEC_BUILTIN_ABS_V4SI: \
_______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits