[LV] Replace use of getMaxSafeDepDist with isSafeForAnyVector (NFC)
authorFlorian Hahn <flo@fhahn.com>
Fri, 21 Jul 2023 20:05:50 +0000 (22:05 +0200)
committerFlorian Hahn <flo@fhahn.com>
Fri, 21 Jul 2023 20:05:50 +0000 (22:05 +0200)
Replace the use of getMaxSafeDepDistBytes with the more direct
isSafeForAnyVector. This removes the need to define getMaxSafeDepDistBytes.

llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

index f97029c..01c9059 100644 (file)
@@ -371,8 +371,6 @@ public:
     return LAI->getDepChecker().isSafeForAnyVectorWidth();
   }
 
-  unsigned getMaxSafeDepDistBytes() { return LAI->getMaxSafeDepDistBytes(); }
-
   uint64_t getMaxSafeVectorWidthInBits() const {
     return LAI->getDepChecker().getMaxSafeVectorWidthInBits();
   }
index e1bd92e..d7e40e8 100644 (file)
@@ -5784,7 +5784,7 @@ LoopVectorizationCostModel::selectInterleaveCount(ElementCount VF,
     return 1;
 
   // We used the distance for the interleave count.
-  if (Legal->getMaxSafeDepDistBytes() != -1U)
+  if (!Legal->isSafeForAnyVectorWidth())
     return 1;
 
   auto BestKnownTC = getSmallBestKnownTC(*PSE.getSE(), TheLoop);