From bf45e742540cd14e44a2a065d8b9a32b49e95957 Mon Sep 17 00:00:00 2001 From: Tobias Grosser Date: Sun, 25 Oct 2015 13:48:40 +0000 Subject: 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 --- polly/lib/Analysis/ScopDetectionDiagnostic.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'polly/lib/Analysis/ScopDetectionDiagnostic.cpp') 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 @@ -348,6 +348,29 @@ bool ReportFuncCall::classof(const RejectReason *RR) { return RR->getKind() == rrkFuncCall; } +//===----------------------------------------------------------------------===// +// 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. -- cgit v1.2.3