[MDA] Use common code instead of reimplementing same. [NFC]

llvm-svn: 322747
This commit is contained in:
Philip Reames 2018-01-17 19:57:19 +00:00
parent 6c3871b139
commit f5ff5d584e

View File

@ -154,24 +154,16 @@ static ModRefInfo GetLocation(const Instruction *Inst, MemoryLocation &Loc,
}
if (const IntrinsicInst *II = dyn_cast<IntrinsicInst>(Inst)) {
AAMDNodes AAInfo;
switch (II->getIntrinsicID()) {
case Intrinsic::lifetime_start:
case Intrinsic::lifetime_end:
case Intrinsic::invariant_start:
II->getAAMetadata(AAInfo);
Loc = MemoryLocation(
II->getArgOperand(1),
cast<ConstantInt>(II->getArgOperand(0))->getZExtValue(), AAInfo);
Loc = MemoryLocation::getForArgument(II, 1, TLI);
// These intrinsics don't really modify the memory, but returning Mod
// will allow them to be handled conservatively.
return ModRefInfo::Mod;
case Intrinsic::invariant_end:
II->getAAMetadata(AAInfo);
Loc = MemoryLocation(
II->getArgOperand(2),
cast<ConstantInt>(II->getArgOperand(1))->getZExtValue(), AAInfo);
Loc = MemoryLocation::getForArgument(II, 2, TLI);
// These intrinsics don't really modify the memory, but returning Mod
// will allow them to be handled conservatively.
return ModRefInfo::Mod;