summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/AliasAnalysis.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-11-17 08:15:14 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-11-17 08:15:14 +0000
commit6727c015dcf3dc81957c515c0f6bd36a55925ad3 (patch)
treeb57f5a62a0e9d1bb6ceffe9155e3cf5aa81446e8 /llvm/lib/Analysis/AliasAnalysis.cpp
parent0345b0fa9ea3aaabfcc807796de159410bbb5861 (diff)
downloadbcm5719-llvm-6727c015dcf3dc81957c515c0f6bd36a55925ad3.tar.gz
bcm5719-llvm-6727c015dcf3dc81957c515c0f6bd36a55925ad3.zip
[AliasAnalysis] CatchPad and CatchRet can modify escaped memory
CatchPad and CatchRet behave a lot like function calls: they can potentially modify any memory which has been escaped. llvm-svn: 253323
Diffstat (limited to 'llvm/lib/Analysis/AliasAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/AliasAnalysis.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/AliasAnalysis.cpp b/llvm/lib/Analysis/AliasAnalysis.cpp
index 0fef5c66651..35f2e97622f 100644
--- a/llvm/lib/Analysis/AliasAnalysis.cpp
+++ b/llvm/lib/Analysis/AliasAnalysis.cpp
@@ -247,6 +247,32 @@ ModRefInfo AAResults::getModRefInfo(const VAArgInst *V,
return MRI_ModRef;
}
+ModRefInfo AAResults::getModRefInfo(const CatchPadInst *CatchPad,
+ const MemoryLocation &Loc) {
+ if (Loc.Ptr) {
+ // If the pointer is a pointer to constant memory,
+ // then it could not have been modified by this catchpad.
+ if (pointsToConstantMemory(Loc))
+ return MRI_NoModRef;
+ }
+
+ // Otherwise, a catchpad reads and writes.
+ return MRI_ModRef;
+}
+
+ModRefInfo AAResults::getModRefInfo(const CatchReturnInst *CatchRet,
+ const MemoryLocation &Loc) {
+ if (Loc.Ptr) {
+ // If the pointer is a pointer to constant memory,
+ // then it could not have been modified by this catchpad.
+ if (pointsToConstantMemory(Loc))
+ return MRI_NoModRef;
+ }
+
+ // Otherwise, a catchret reads and writes.
+ return MRI_ModRef;
+}
+
ModRefInfo AAResults::getModRefInfo(const AtomicCmpXchgInst *CX,
const MemoryLocation &Loc) {
// Acquire/Release cmpxchg has properties that matter for arbitrary addresses.
OpenPOWER on IntegriCloud