X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FAnalysis%2FAliasAnalysis.cpp;h=7a94c431deeafe49825175aed8caec13f0379757;hb=124708d9b47cc53cb11d8bfed75b241b6eec86d4;hp=f452c9e67661b776588de7cc49facfa910e86472;hpb=e90c5cb747631b315350e7ee7424048c7778bdf9;p=oota-llvm.git diff --git a/lib/Analysis/AliasAnalysis.cpp b/lib/Analysis/AliasAnalysis.cpp index f452c9e6766..7a94c431dee 100644 --- a/lib/Analysis/AliasAnalysis.cpp +++ b/lib/Analysis/AliasAnalysis.cpp @@ -219,18 +219,24 @@ AliasAnalysis::getLocationForSource(const MemTransferInst *MTI) { if (ConstantInt *C = dyn_cast(MTI->getLength())) Size = C->getValue().getZExtValue(); - // FIXME: Can memcpy/memmove have TBAA tags? - return Location(MTI->getRawSource(), Size, 0); + // memcpy/memmove can have TBAA tags. For memcpy, they apply + // to both the source and the destination. + MDNode *TBAATag = MTI->getMetadata(LLVMContext::MD_tbaa); + + return Location(MTI->getRawSource(), Size, TBAATag); } AliasAnalysis::Location -AliasAnalysis::getLocationForDest(const MemTransferInst *MTI) { +AliasAnalysis::getLocationForDest(const MemIntrinsic *MTI) { uint64_t Size = UnknownSize; if (ConstantInt *C = dyn_cast(MTI->getLength())) Size = C->getValue().getZExtValue(); + + // memcpy/memmove can have TBAA tags. For memcpy, they apply + // to both the source and the destination. + MDNode *TBAATag = MTI->getMetadata(LLVMContext::MD_tbaa); - // FIXME: Can memcpy/memmove have TBAA tags? - return Location(MTI->getRawDest(), Size, 0); + return Location(MTI->getRawDest(), Size, TBAATag); }