diff options
author | Dan Gohman <gohman@apple.com> | 2010-11-11 21:50:19 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-11-11 21:50:19 +0000 |
commit | 6d8eb156e6be727570b300bac7712f745a318c7d (patch) | |
tree | cd4250cc4395e8077f2dac80017fbe44ae96a94b /lib/Transforms/Scalar/Sink.cpp | |
parent | ef5b390263ebe6e22c89cb16faebf0fb3c4ce1ee (diff) | |
download | llvm-6d8eb156e6be727570b300bac7712f745a318c7d.tar.gz llvm-6d8eb156e6be727570b300bac7712f745a318c7d.tar.bz2 llvm-6d8eb156e6be727570b300bac7712f745a318c7d.tar.xz |
Add helper functions for computing the Location of load, store,
and vaarg instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118845 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/Sink.cpp')
-rw-r--r-- | lib/Transforms/Scalar/Sink.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/Transforms/Scalar/Sink.cpp b/lib/Transforms/Scalar/Sink.cpp index a54ba8e0ae..705f442049 100644 --- a/lib/Transforms/Scalar/Sink.cpp +++ b/lib/Transforms/Scalar/Sink.cpp @@ -15,7 +15,6 @@ #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" @@ -157,10 +156,7 @@ static bool isSafeToMove(Instruction *Inst, AliasAnalysis *AA, if (LoadInst *L = dyn_cast<LoadInst>(Inst)) { if (L->isVolatile()) return false; - 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); + AliasAnalysis::Location Loc = AA->getLocation(L); for (SmallPtrSet<Instruction *, 8>::iterator I = Stores.begin(), E = Stores.end(); I != E; ++I) if (AA->getModRefInfo(*I, Loc) & AliasAnalysis::Mod) |