diff options
author | Dan Gohman <gohman@apple.com> | 2010-11-11 16:21:47 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-11-11 16:21:47 +0000 |
commit | 0cc4c7516e2e5b1feaa9850de03615b6329ef919 (patch) | |
tree | 85d6ec798dcb36b4afc01e1e4f9b69ba6c9cc48b /llvm/lib/Transforms | |
parent | c3b4ea7b7d7e1c6f2e29ef3c85f798d94741111a (diff) | |
download | bcm5719-llvm-0cc4c7516e2e5b1feaa9850de03615b6329ef919.tar.gz bcm5719-llvm-0cc4c7516e2e5b1feaa9850de03615b6329ef919.zip |
Make Sink tbaa-aware.
llvm-svn: 118788
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/Sink.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/Sink.cpp b/llvm/lib/Transforms/Scalar/Sink.cpp index d6f1e93a812..a54ba8e0ae5 100644 --- a/llvm/lib/Transforms/Scalar/Sink.cpp +++ b/llvm/lib/Transforms/Scalar/Sink.cpp @@ -15,6 +15,7 @@ #define DEBUG_TYPE "sink" #include "llvm/Transforms/Scalar.h" #include "llvm/IntrinsicInst.h" +#include "llvm/LLVMContext.h" #include "llvm/Analysis/Dominators.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Analysis/AliasAnalysis.h" @@ -158,9 +159,11 @@ static bool isSafeToMove(Instruction *Inst, AliasAnalysis *AA, Value *Ptr = L->getPointerOperand(); uint64_t Size = AA->getTypeStoreSize(L->getType()); + const MDNode *TBAAInfo = L->getMetadata(LLVMContext::MD_tbaa); + AliasAnalysis::Location Loc(Ptr, Size, TBAAInfo); for (SmallPtrSet<Instruction *, 8>::iterator I = Stores.begin(), E = Stores.end(); I != E; ++I) - if (AA->getModRefInfo(*I, Ptr, Size) & AliasAnalysis::Mod) + if (AA->getModRefInfo(*I, Loc) & AliasAnalysis::Mod) return false; } |