summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/AliasAnalysis.cpp
diff options
context:
space:
mode:
authorNicolai Haehnle <nhaehnle@gmail.com>2016-07-04 08:01:29 +0000
committerNicolai Haehnle <nhaehnle@gmail.com>2016-07-04 08:01:29 +0000
commit84c9f9919a1b0e7a80af6854ec3507770ae854f7 (patch)
tree130469c2de412fd58816b2edde5a9e917070dc91 /llvm/lib/Analysis/AliasAnalysis.cpp
parentac1823f6e947ffee2f5171a59cc2afc175b66781 (diff)
downloadbcm5719-llvm-84c9f9919a1b0e7a80af6854ec3507770ae854f7.tar.gz
bcm5719-llvm-84c9f9919a1b0e7a80af6854ec3507770ae854f7.zip
Add writeonly IR attribute
Summary: This complements the earlier addition of IntrWriteMem and IntrWriteArgMem LLVM intrinsic properties, see D18291. Also start using the attribute for memset, memcpy, and memmove intrinsics, and remove their special-casing in BasicAliasAnalysis. Reviewers: reames, joker.eph Subscribers: joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D18714 llvm-svn: 274485
Diffstat (limited to 'llvm/lib/Analysis/AliasAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/AliasAnalysis.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/AliasAnalysis.cpp b/llvm/lib/Analysis/AliasAnalysis.cpp
index 263dd48bfea..a9d4610ed67 100644
--- a/llvm/lib/Analysis/AliasAnalysis.cpp
+++ b/llvm/lib/Analysis/AliasAnalysis.cpp
@@ -142,6 +142,8 @@ ModRefInfo AAResults::getModRefInfo(ImmutableCallSite CS,
if (onlyReadsMemory(MRB))
Result = ModRefInfo(Result & MRI_Ref);
+ else if (doesNotReadMemory(MRB))
+ Result = ModRefInfo(Result & MRI_Mod);
if (onlyAccessesArgPointees(MRB)) {
bool DoesAlias = false;
@@ -207,6 +209,8 @@ ModRefInfo AAResults::getModRefInfo(ImmutableCallSite CS1,
// from CS1 reading memory written by CS2.
if (onlyReadsMemory(CS1B))
Result = ModRefInfo(Result & MRI_Ref);
+ else if (doesNotReadMemory(CS1B))
+ Result = ModRefInfo(Result & MRI_Mod);
// If CS2 only access memory through arguments, accumulate the mod/ref
// information from CS1's references to the memory referenced by
OpenPOWER on IntegriCloud