ScopDetect: Bail out for non-simple memory accesses
Volatile or atomic memory accesses are currently not supported. Neither did
we think about any special handling needed nor do we support the unknown
instructions the alias set tracker turns them into sometimes. Before this
patch, us not supporting unkown instructions in an alias set caused the
following assertion failures:
Assertion `AG.size() > 1 && "Alias groups should contain at least two accesses"'
failed
llvm-svn: 251234
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp
index 79461c8..2fa45ad 100644
--- a/polly/lib/Analysis/ScopDetection.cpp
+++ b/polly/lib/Analysis/ScopDetection.cpp
@@ -749,6 +749,15 @@
if (isa<LoadInst>(Inst) || isa<StoreInst>(Inst)) {
Context.hasStores |= isa<StoreInst>(Inst);
Context.hasLoads |= isa<LoadInst>(Inst);
+ if (auto *Load = dyn_cast<LoadInst>(&Inst))
+ if (!Load->isSimple())
+ return invalid<ReportNonSimpleMemoryAccess>(Context, /*Assert=*/true,
+ &Inst);
+ if (auto *Store = dyn_cast<StoreInst>(&Inst))
+ if (!Store->isSimple())
+ return invalid<ReportNonSimpleMemoryAccess>(Context, /*Assert=*/true,
+ &Inst);
+
return isValidMemoryAccess(Inst, Context);
}