Skip to content

Commit 57587fa

Browse files
committed
Deal with change in dep type to IndirectUnsafe
1 parent 35e7eeb commit 57587fa

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
@@ -1127,12 +1127,12 @@ static bool findHistogram(LoadInst *LI, StoreInst *HSt, Loop *TheLoop,
11271127
return true;
11281128
}
11291129

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

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

11431143
const MemoryDepChecker::Dependence &Dep = (*Deps).front();
11441144

1145-
// We're only interested in unknown dependences.
1146-
if (Dep.Type != MemoryDepChecker::Dependence::Unknown)
1145+
// We're only interested in Unknown or IndirectUnsafe dependences.
1146+
if (Dep.Type != MemoryDepChecker::Dependence::Unknown &&
1147+
Dep.Type != MemoryDepChecker::Dependence::IndirectUnsafe)
11471148
return false;
11481149

11491150
// For now only normal loads and stores are supported.
@@ -1168,7 +1169,7 @@ bool LoopVectorizationLegality::canVectorizeMemory() {
11681169
}
11691170

11701171
if (!LAI->canVectorizeMemory())
1171-
return canVectorizeUnknownDependences();
1172+
return canVectorizeUncheckedDependences();
11721173

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

0 commit comments

Comments
 (0)