From 5e5feb770e1aa540c32c897da0cee65115755ccf Mon Sep 17 00:00:00 2001 From: Tobias Grosser Date: Sun, 13 Nov 2016 19:27:24 +0000 Subject: [PATCH] [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. git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@286771 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/ScopBuilder.cpp | 2 ++ lib/Analysis/ScopDetection.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/Analysis/ScopBuilder.cpp b/lib/Analysis/ScopBuilder.cpp index a38629ed..0e03118a 100644 --- a/lib/Analysis/ScopBuilder.cpp +++ b/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/lib/Analysis/ScopDetection.cpp b/lib/Analysis/ScopDetection.cpp index a34c4edc..d23b9d5a 100644 --- a/lib/Analysis/ScopDetection.cpp +++ b/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; } } -- 2.11.4.GIT