summaryrefslogtreecommitdiff
path: root/lib/Analysis/DependenceAnalysis.cpp
diff options
context:
space:
mode:
authorPreston Briggs <preston.briggs@gmail.com>2012-11-27 06:41:46 +0000
committerPreston Briggs <preston.briggs@gmail.com>2012-11-27 06:41:46 +0000
commit6ee74f52e987036ced56293d50580f8208b863f5 (patch)
treeb8338e4999ab5d8140f0f293f9bbe01750bd77b3 /lib/Analysis/DependenceAnalysis.cpp
parent69ea027e045f359b48bd436d530fc443a7cbb5c9 (diff)
downloadllvm-6ee74f52e987036ced56293d50580f8208b863f5.tar.gz
llvm-6ee74f52e987036ced56293d50580f8208b863f5.tar.bz2
llvm-6ee74f52e987036ced56293d50580f8208b863f5.tar.xz
Modify depends(Src, Dst, PossiblyLoopIndependent).
If the Src and Dst are the same instruction, no loop-independent dependence is possible, so we force the PossiblyLoopIndependent flag to false. The test case results are updated appropriately. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168678 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DependenceAnalysis.cpp')
-rw-r--r--lib/Analysis/DependenceAnalysis.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Analysis/DependenceAnalysis.cpp b/lib/Analysis/DependenceAnalysis.cpp
index 684da98ce2..385e779a59 100644
--- a/lib/Analysis/DependenceAnalysis.cpp
+++ b/lib/Analysis/DependenceAnalysis.cpp
@@ -3199,6 +3199,9 @@ static void dumpSmallBitVector(SmallBitVector &BV) {
Dependence *DependenceAnalysis::depends(Instruction *Src,
Instruction *Dst,
bool PossiblyLoopIndependent) {
+ if (Src == Dst)
+ PossiblyLoopIndependent = false;
+
if ((!Src->mayReadFromMemory() && !Src->mayWriteToMemory()) ||
(!Dst->mayReadFromMemory() && !Dst->mayWriteToMemory()))
// if both instructions don't reference memory, there's no dependence