diff options
author | Andreas Bolka <a@bolka.at> | 2009-06-29 18:51:11 +0000 |
---|---|---|
committer | Andreas Bolka <a@bolka.at> | 2009-06-29 18:51:11 +0000 |
commit | fc8a04aebe88b88db9059b5c20423014f9d043ab (patch) | |
tree | 4324b9af7028cad2d0ea46135e3b07a4e58c3c2f /lib | |
parent | 0f48d6fc7e949c1f0b4a6a6fda946bf64f22cdcf (diff) | |
download | external_llvm-fc8a04aebe88b88db9059b5c20423014f9d043ab.zip external_llvm-fc8a04aebe88b88db9059b5c20423014f9d043ab.tar.gz external_llvm-fc8a04aebe88b88db9059b5c20423014f9d043ab.tar.bz2 |
Relax LDA memory instruction checks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74439 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Analysis/LoopDependenceAnalysis.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/Analysis/LoopDependenceAnalysis.cpp b/lib/Analysis/LoopDependenceAnalysis.cpp index 779508d..020a8c7 100644 --- a/lib/Analysis/LoopDependenceAnalysis.cpp +++ b/lib/Analysis/LoopDependenceAnalysis.cpp @@ -36,8 +36,9 @@ char LoopDependenceAnalysis::ID = 0; // Utility Functions //===----------------------------------------------------------------------===// -static inline bool IsMemRefInstr(const Value *I) { - return isa<LoadInst>(I) || isa<StoreInst>(I); +static inline bool IsMemRefInstr(const Value *V) { + const Instruction *I = dyn_cast<const Instruction>(V); + return I && (I->mayReadFromMemory() || I->mayWriteToMemory()); } static void GetMemRefInstrs( @@ -56,8 +57,10 @@ static void GetMemRefInstrs( bool LoopDependenceAnalysis::isDependencePair(const Value *x, const Value *y) const { - return IsMemRefInstr(x) && IsMemRefInstr(y) - && (isa<StoreInst>(x) || isa<StoreInst>(y)); + return IsMemRefInstr(x) && + IsMemRefInstr(y) && + (cast<const Instruction>(x)->mayWriteToMemory() || + cast<const Instruction>(y)->mayWriteToMemory()); } bool LoopDependenceAnalysis::depends(Value *src, Value *dst) { |