mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-19 23:23:38 -04:00
[AliasSetTracker] Add support for memcpy and memmove.
Differential Revision: https://reviews.llvm.org/D25776 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284630 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -389,6 +389,27 @@ void AliasSetTracker::add(MemSetInst *MSI) {
|
||||
AS.setVolatile();
|
||||
}
|
||||
|
||||
void AliasSetTracker::add(MemTransferInst *MTI) {
|
||||
AAMDNodes AAInfo;
|
||||
MTI->getAAMetadata(AAInfo);
|
||||
|
||||
uint64_t Len;
|
||||
if (ConstantInt *C = dyn_cast<ConstantInt>(MTI->getLength()))
|
||||
Len = C->getZExtValue();
|
||||
else
|
||||
Len = MemoryLocation::UnknownSize;
|
||||
|
||||
AliasSet &ASSrc =
|
||||
addPointer(MTI->getRawSource(), Len, AAInfo, AliasSet::RefAccess);
|
||||
if (MTI->isVolatile())
|
||||
ASSrc.setVolatile();
|
||||
|
||||
AliasSet &ASDst =
|
||||
addPointer(MTI->getRawDest(), Len, AAInfo, AliasSet::ModAccess);
|
||||
if (MTI->isVolatile())
|
||||
ASDst.setVolatile();
|
||||
}
|
||||
|
||||
void AliasSetTracker::addUnknown(Instruction *Inst) {
|
||||
if (isa<DbgInfoIntrinsic>(Inst))
|
||||
return; // Ignore DbgInfo Intrinsics.
|
||||
@@ -415,8 +436,9 @@ void AliasSetTracker::add(Instruction *I) {
|
||||
return add(VAAI);
|
||||
if (MemSetInst *MSI = dyn_cast<MemSetInst>(I))
|
||||
return add(MSI);
|
||||
if (MemTransferInst *MTI = dyn_cast<MemTransferInst>(I))
|
||||
return add(MTI);
|
||||
return addUnknown(I);
|
||||
// FIXME: add support of memcpy and memmove.
|
||||
}
|
||||
|
||||
void AliasSetTracker::add(BasicBlock &BB) {
|
||||
|
||||
Reference in New Issue
Block a user