[LoopAccesses] Cache the result of canVectorizeMemory
[oota-llvm.git] / lib / Transforms / Vectorize / LoopVectorize.cpp
index 8b671355ebd9d8b949d6d4154f8eeb0da2d04101..2ba7913119fd46c0e4410d152b058d90cc39a72d 100644 (file)
@@ -3807,11 +3807,11 @@ void LoopVectorizationLegality::collectLoopUniforms() {
 }
 
 bool LoopVectorizationLegality::canVectorizeMemory() {
-  bool Success = LAI.canVectorizeMemory(Strides);
+  LAI.analyzeLoop(Strides);
   auto &OptionalReport = LAI.getReport();
   if (OptionalReport)
     emitAnalysis(*OptionalReport);
-  return Success;
+  return LAI.canVectorizeMemory();
 }
 
 static bool hasMultipleUsesOf(Instruction *I,