TargetData &TD = getAnalysis<TargetData>();
AliasAnalysis &AA = getAnalysis<AliasAnalysis>();
+ LLVMContext &Context = SI->getContext();
+ 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 = Context.getPointerTypeUnqual(Type::Int8Ty);
if (StartPtr->getType() != i8Ptr)
StartPtr = new BitCastInst(StartPtr, i8Ptr, StartPtr->getName(),
InsertPt);