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
This commit is contained in:
Preston Briggs
2012-11-27 19:12:26 +00:00
parent cc7773bdcb
commit 3c1cc3888b
16 changed files with 376 additions and 361 deletions
+16 -1
View File
@@ -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;