diff options
Diffstat (limited to 'polly/lib/Analysis')
-rw-r--r-- | polly/lib/Analysis/ScopDetection.cpp | 9 | ||||
-rw-r--r-- | polly/lib/Analysis/ScopDetectionDiagnostic.cpp | 23 |
2 files changed, 32 insertions, 0 deletions
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp index 79461c8583c..2fa45addc2f 100644 --- a/polly/lib/Analysis/ScopDetection.cpp +++ b/polly/lib/Analysis/ScopDetection.cpp @@ -749,6 +749,15 @@ bool ScopDetection::isValidInstruction(Instruction &Inst, 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); } diff --git a/polly/lib/Analysis/ScopDetectionDiagnostic.cpp b/polly/lib/Analysis/ScopDetectionDiagnostic.cpp index 1943dfc37f1..4eabfc9c9de 100644 --- a/polly/lib/Analysis/ScopDetectionDiagnostic.cpp +++ b/polly/lib/Analysis/ScopDetectionDiagnostic.cpp @@ -349,6 +349,29 @@ bool ReportFuncCall::classof(const RejectReason *RR) { } //===----------------------------------------------------------------------===// +// ReportNonSimpleMemoryAccess + +ReportNonSimpleMemoryAccess::ReportNonSimpleMemoryAccess(Instruction *Inst) + : ReportOther(rrkNonSimpleMemoryAccess), Inst(Inst) {} + +std::string ReportNonSimpleMemoryAccess::getMessage() const { + return "Non-simple memory access: " + *Inst; +} + +const DebugLoc &ReportNonSimpleMemoryAccess::getDebugLoc() const { + return Inst->getDebugLoc(); +} + +std::string ReportNonSimpleMemoryAccess::getEndUserMessage() const { + return "Volatile memory accesses or memory accesses for atomic types " + "are not supported."; +} + +bool ReportNonSimpleMemoryAccess::classof(const RejectReason *RR) { + return RR->getKind() == rrkNonSimpleMemoryAccess; +} + +//===----------------------------------------------------------------------===// // ReportAlias. ReportAlias::ReportAlias(Instruction *Inst, AliasSet &AS) |