diff options
| author | Preston Briggs <preston.briggs@gmail.com> | 2012-11-27 19:12:26 +0000 |
|---|---|---|
| committer | Preston Briggs <preston.briggs@gmail.com> | 2012-11-27 19:12:26 +0000 |
| commit | 5cb8cfae1e8e53d0f0154ba663c2cfb6fa0ca83b (patch) | |
| tree | da6a11c2fa457fdd44425a4ce710ea72fa2821ab /llvm/lib/Analysis | |
| parent | 3e0f1fb7b2a2f3c601f0b84aa52bcb2506d795e9 (diff) | |
| download | bcm5719-llvm-5cb8cfae1e8e53d0f0154ba663c2cfb6fa0ca83b.tar.gz bcm5719-llvm-5cb8cfae1e8e53d0f0154ba663c2cfb6fa0ca83b.zip | |
Modified depends() to recognize that when all levels are "=" and
there's no possible loo-independent dependence, then there's no
dependence.
Updated all test result appropriately.
llvm-svn: 168719
Diffstat (limited to 'llvm/lib/Analysis')
| -rw-r--r-- | llvm/lib/Analysis/DependenceAnalysis.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/DependenceAnalysis.cpp b/llvm/lib/Analysis/DependenceAnalysis.cpp index 385e779a59a..2068f1fb965 100644 --- a/llvm/lib/Analysis/DependenceAnalysis.cpp +++ b/llvm/lib/Analysis/DependenceAnalysis.cpp @@ -3563,8 +3563,10 @@ Dependence *DependenceAnalysis::depends(Instruction *Src, if (CompleteLoops[II]) Result.DV[II - 1].Scalar = false; - // make sure loopIndepent flag is set correctly if (PossiblyLoopIndependent) { + // Make sure the LoopIndependent flag is set correctly. + // All directions must include equal, otherwise no + // loop-independent dependence is possible. for (unsigned II = 1; II <= CommonLevels; ++II) { if (!(Result.getDirection(II) & Dependence::DVEntry::EQ)) { Result.LoopIndependent = false; @@ -3572,6 +3574,19 @@ Dependence *DependenceAnalysis::depends(Instruction *Src, } } } + else { + // On the other hand, if all directions are equal and there's no + // loop-independent dependence possible, then no dependence exists. + bool AllEqual = true; + for (unsigned II = 1; II <= CommonLevels; ++II) { + if (Result.getDirection(II) != Dependence::DVEntry::EQ) { + AllEqual = false; + break; + } + } + if (AllEqual) + return NULL; + } FullDependence *Final = new FullDependence(Result); Result.DV = NULL; |

