// corresponding integer value is "byteable". An important case is 0.0.
if (ConstantFP *CFP = dyn_cast<ConstantFP>(V)) {
if (CFP->getType() == Type::FloatTy)
- V = Context.getConstantExprBitCast(CFP, Type::Int32Ty);
+ V = ConstantExpr::getBitCast(CFP, Type::Int32Ty);
if (CFP->getType() == Type::DoubleTy)
- V = Context.getConstantExprBitCast(CFP, Type::Int64Ty);
+ V = ConstantExpr::getBitCast(CFP, Type::Int64Ty);
// Don't handle long double formats, which have strange constraints.
}
TargetData &TD = getAnalysis<TargetData>();
AliasAnalysis &AA = getAnalysis<AliasAnalysis>();
+ Module *M = SI->getParent()->getParent()->getParent();
// Okay, so we now have a single store that can be splatable. Scan to find
// all subsequent stores of the same value to offset from the same pointer.
if (MemSetF == 0) {
const Type *Tys[] = {Type::Int64Ty};
- MemSetF = Intrinsic::getDeclaration(SI->getParent()->getParent()
- ->getParent(), Intrinsic::memset,
+ MemSetF = Intrinsic::getDeclaration(M, Intrinsic::memset,
Tys, 1);
}
StartPtr = Range.StartPtr;
// Cast the start ptr to be i8* as memset requires.
- const Type *i8Ptr = SI->getContext().getPointerTypeUnqual(Type::Int8Ty);
+ const Type *i8Ptr = PointerType::getUnqual(Type::Int8Ty);
if (StartPtr->getType() != i8Ptr)
- StartPtr = new BitCastInst(StartPtr, i8Ptr, StartPtr->getNameStart(),
+ StartPtr = new BitCastInst(StartPtr, i8Ptr, StartPtr->getName(),
InsertPt);
Value *Ops[] = {