Skip to content

Commit b0317b8

Browse files
committed
Deal with change in dep type to IndirectUnsafe
1 parent bc4105c commit b0317b8

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
@@ -1132,12 +1132,12 @@ static bool findHistogram(LoadInst *LI, StoreInst *HSt, Loop *TheLoop,
11321132
return true;
11331133
}
11341134

1135-
bool LoopVectorizationLegality::canVectorizeUnknownDependences() {
1135+
bool LoopVectorizationLegality::canVectorizeUncheckedDependences() {
11361136
// For now, we only support an unknown dependency that calculates a histogram
11371137
if (!EnableHistogramVectorization)
11381138
return false;
11391139

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

11481148
const MemoryDepChecker::Dependence &Dep = (*Deps).front();
11491149

1150-
// We're only interested in unknown dependences.
1151-
if (Dep.Type != MemoryDepChecker::Dependence::Unknown)
1150+
// We're only interested in Unknown or IndirectUnsafe dependences.
1151+
if (Dep.Type != MemoryDepChecker::Dependence::Unknown &&
1152+
Dep.Type != MemoryDepChecker::Dependence::IndirectUnsafe)
11521153
return false;
11531154

11541155
// For now only normal loads and stores are supported.
@@ -1173,7 +1174,7 @@ bool LoopVectorizationLegality::canVectorizeMemory() {
11731174
}
11741175

11751176
if (!LAI->canVectorizeMemory())
1176-
return canVectorizeUnknownDependences();
1177+
return canVectorizeUncheckedDependences();
11771178

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

0 commit comments

Comments
 (0)