aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/LoopDependenceAnalysis.cpp
diff options
context:
space:
mode:
authorAndreas Bolka <a@bolka.at>2009-06-29 18:51:11 +0000
committerAndreas Bolka <a@bolka.at>2009-06-29 18:51:11 +0000
commit6037bc9e60607c4eb30f34c10f6f554c7da42205 (patch)
tree60e989f44fb1d3e593b3e1ea70c7eabea0347c74 /llvm/lib/Analysis/LoopDependenceAnalysis.cpp
parent24c7835d19a4a7bfa87e5859a072bc23a0df1429 (diff)
downloadllvm-6037bc9e60607c4eb30f34c10f6f554c7da42205.zip
llvm-6037bc9e60607c4eb30f34c10f6f554c7da42205.tar.gz
llvm-6037bc9e60607c4eb30f34c10f6f554c7da42205.tar.bz2
Relax LDA memory instruction checks.
llvm-svn: 74439
Diffstat (limited to 'llvm/lib/Analysis/LoopDependenceAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/LoopDependenceAnalysis.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/LoopDependenceAnalysis.cpp b/llvm/lib/Analysis/LoopDependenceAnalysis.cpp
index 779508d..020a8c7 100644
--- a/llvm/lib/Analysis/LoopDependenceAnalysis.cpp
+++ b/llvm/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) {