summaryrefslogtreecommitdiff
path: root/lib/Analysis/DependenceAnalysis.cpp
diff options
context:
space:
mode:
authorPreston Briggs <preston.briggs@gmail.com>2012-11-27 19:12:26 +0000
committerPreston Briggs <preston.briggs@gmail.com>2012-11-27 19:12:26 +0000
commit3c1cc3888bbfbb568dad296f577c63eba8999a72 (patch)
tree37760083ef201306b4434bb034c74cc1f3e677cb /lib/Analysis/DependenceAnalysis.cpp
parentcc7773bdcbecf893cb9442a77cdf5e41f2af4256 (diff)
downloadllvm-3c1cc3888bbfbb568dad296f577c63eba8999a72.tar.gz
llvm-3c1cc3888bbfbb568dad296f577c63eba8999a72.tar.bz2
llvm-3c1cc3888bbfbb568dad296f577c63eba8999a72.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168719 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DependenceAnalysis.cpp')
-rw-r--r--lib/Analysis/DependenceAnalysis.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/Analysis/DependenceAnalysis.cpp b/lib/Analysis/DependenceAnalysis.cpp
index 385e779a59..2068f1fb96 100644
--- a/lib/Analysis/DependenceAnalysis.cpp
+++ b/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;