From: Tobias Grosser Date: Sun, 13 Nov 2016 19:27:24 +0000 (+0000) Subject: [ScopDetect] Conservatively handle inaccessible memory alias attributes X-Git-Tag: llvmorg-4.0.0-rc1~4727 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=70d2709b1a4ba47232dee8ffb02ebc768fc7ca5d;p=platform%2Fupstream%2Fllvm.git [ScopDetect] Conservatively handle inaccessible memory alias attributes Commit r286294 introduced support for inaccessiblememonly and inaccessiblemem_or_argmemonly attributes to BasicAA, which we need to support to avoid undefined behavior. This change just refuses all calls which are annotated with these attributes, which is conservatively correct. In the future we may consider to model and support such function calls in Polly. llvm-svn: 286771 --- diff --git a/polly/lib/Analysis/ScopBuilder.cpp b/polly/lib/Analysis/ScopBuilder.cpp index a38629e..0e03118 100644 --- a/polly/lib/Analysis/ScopBuilder.cpp +++ b/polly/lib/Analysis/ScopBuilder.cpp @@ -322,6 +322,8 @@ bool ScopBuilder::buildAccessCallInst(MemAccInst Inst, Loop *L) { case llvm::FMRB_DoesNotAccessMemory: return true; case llvm::FMRB_DoesNotReadMemory: + case llvm::FMRB_OnlyAccessesInaccessibleMem: + case llvm::FMRB_OnlyAccessesInaccessibleOrArgMem: return false; case llvm::FMRB_OnlyReadsMemory: GlobalReads.push_back(CI); diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp index a34c4ed..d23b9d5 100644 --- a/polly/lib/Analysis/ScopDetection.cpp +++ b/polly/lib/Analysis/ScopDetection.cpp @@ -491,6 +491,8 @@ bool ScopDetection::isValidCallInst(CallInst &CI, Context.AST.add(&CI); return true; case FMRB_DoesNotReadMemory: + case FMRB_OnlyAccessesInaccessibleMem: + case FMRB_OnlyAccessesInaccessibleOrArgMem: return false; } }