Skip to content

Commit 7e7be73

Browse files
committed
Deal with change in dep type to IndirectUnsafe
1 parent 8585e4a commit 7e7be73

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ class LoopVectorizationLegality {
469469
/// If LAA cannot determine whether all dependences are safe, we may be able
470470
/// to further analyse some unknown dependences and if they match a certain
471471
/// pattern (like a histogram) then we may still be able to vectorize.
472-
bool canVectorizeUnknownDependences();
472+
bool canVectorizeUncheckedDependences();
473473

474474
/// Return true if we can vectorize this loop using the IF-conversion
475475
/// transformation.

llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,12 +1129,12 @@ static bool findHistogram(LoadInst *LI, StoreInst *HSt, Loop *TheLoop,
11291129
return true;
11301130
}
11311131

1132-
bool LoopVectorizationLegality::canVectorizeUnknownDependences() {
1132+
bool LoopVectorizationLegality::canVectorizeUncheckedDependences() {
11331133
// For now, we only support an unknown dependency that calculates a histogram
11341134
if (!EnableHistogramVectorization)
11351135
return false;
11361136

1137-
// FIXME: Support more than one unknown dependence, and check to see if some
1137+
// FIXME: Support more than one unchecked dependence, and check to see if some
11381138
// are handled by runtime checks before looking for histograms.
11391139
LAI = &LAIs.getInfo(*TheLoop);
11401140
const MemoryDepChecker &DepChecker = LAI->getDepChecker();
@@ -1144,8 +1144,9 @@ bool LoopVectorizationLegality::canVectorizeUnknownDependences() {
11441144

11451145
const MemoryDepChecker::Dependence &Dep = (*Deps).front();
11461146

1147-
// We're only interested in unknown dependences.
1148-
if (Dep.Type != MemoryDepChecker::Dependence::Unknown)
1147+
// We're only interested in Unknown or IndirectUnsafe dependences.
1148+
if (Dep.Type != MemoryDepChecker::Dependence::Unknown &&
1149+
Dep.Type != MemoryDepChecker::Dependence::IndirectUnsafe)
11491150
return false;
11501151

11511152
// For now only normal loads and stores are supported.
@@ -1170,7 +1171,7 @@ bool LoopVectorizationLegality::canVectorizeMemory() {
11701171
}
11711172

11721173
if (!LAI->canVectorizeMemory())
1173-
return canVectorizeUnknownDependences();
1174+
return canVectorizeUncheckedDependences();
11741175

11751176
if (LAI->hasLoadStoreDependenceInvolvingLoopInvariantAddress()) {
11761177
reportVectorizationFailure("We don't allow storing to uniform addresses",

0 commit comments

Comments
 (0)