Reduce dyn_cast<> to isa<> or cast<> where possible.
[oota-llvm.git] / lib / Transforms / Vectorize / LoopVectorize.cpp
index 21588568edefab5ad358d9c239596222fe9af9c6..8986932309a5fa2167292a2e978ba5b9046af58c 100644 (file)
@@ -4009,6 +4009,14 @@ bool LoopVectorizationLegality::canVectorizeMemory() {
   if (!LAI->canVectorizeMemory())
     return false;
 
+  if (LAI->hasStoreToLoopInvariantAddress()) {
+    emitAnalysis(
+        VectorizationReport()
+        << "write to a loop invariant address could not be vectorized");
+    DEBUG(dbgs() << "LV: We don't allow storing to uniform addresses\n");
+    return false;
+  }
+
   if (LAI->getNumRuntimePointerChecks() >
       VectorizerParams::RuntimeMemoryCheckThreshold) {
     emitAnalysis(VectorizationReport()