mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
add "getLocation" method to AliasAnalysis for getting the source and
destination location of a memcpy/memmove. I'm not clear about whether TBAA works on these, so I'm leaving it out for now. Dan, please revisit this when convenient. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119928 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -212,6 +212,29 @@ AliasAnalysis::Location AliasAnalysis::getLocation(const VAArgInst *VI) {
|
||||
VI->getMetadata(LLVMContext::MD_tbaa));
|
||||
}
|
||||
|
||||
|
||||
AliasAnalysis::Location
|
||||
AliasAnalysis::getLocationForSource(const MemTransferInst *MTI) {
|
||||
uint64_t Size = UnknownSize;
|
||||
if (ConstantInt *C = dyn_cast<ConstantInt>(MTI->getLength()))
|
||||
Size = C->getValue().getZExtValue();
|
||||
|
||||
// FIXME: Can memcpy/memmove have TBAA tags?
|
||||
return Location(MTI->getRawSource(), Size, 0);
|
||||
}
|
||||
|
||||
AliasAnalysis::Location
|
||||
AliasAnalysis::getLocationForDest(const MemTransferInst *MTI) {
|
||||
uint64_t Size = UnknownSize;
|
||||
if (ConstantInt *C = dyn_cast<ConstantInt>(MTI->getLength()))
|
||||
Size = C->getValue().getZExtValue();
|
||||
|
||||
// FIXME: Can memcpy/memmove have TBAA tags?
|
||||
return Location(MTI->getRawDest(), Size, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
AliasAnalysis::ModRefResult
|
||||
AliasAnalysis::getModRefInfo(const LoadInst *L, const Location &Loc) {
|
||||
// Be conservative in the face of volatile.
|
||||
|
Reference in New Issue
Block a user