diff options
author | Preston Briggs <preston.briggs@gmail.com> | 2012-11-27 06:41:46 +0000 |
---|---|---|
committer | Preston Briggs <preston.briggs@gmail.com> | 2012-11-27 06:41:46 +0000 |
commit | 1084fa2ef262f554d9c44a2e22f2dd3eaadc984f (patch) | |
tree | 1be0452a532785fa709e9b67e8189f1c85e2287a /llvm/lib/Analysis/DependenceAnalysis.cpp | |
parent | 25c9b3b6e46565abdacff6de5817e8abd9eb2ac8 (diff) | |
download | bcm5719-llvm-1084fa2ef262f554d9c44a2e22f2dd3eaadc984f.tar.gz bcm5719-llvm-1084fa2ef262f554d9c44a2e22f2dd3eaadc984f.zip |
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.
llvm-svn: 168678
Diffstat (limited to 'llvm/lib/Analysis/DependenceAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/DependenceAnalysis.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/DependenceAnalysis.cpp b/llvm/lib/Analysis/DependenceAnalysis.cpp index 684da98ce25..385e779a59a 100644 --- a/llvm/lib/Analysis/DependenceAnalysis.cpp +++ b/llvm/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 |