diff options
author | David Majnemer <david.majnemer@gmail.com> | 2016-07-15 17:19:24 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2016-07-15 17:19:24 +0000 |
commit | a940f360cbaa1fb0da984c5cd311efe85a7d88ae (patch) | |
tree | baffc2b5634d136cf428f8e8d1b6d17499fe246f /llvm/lib/Analysis/AliasAnalysis.cpp | |
parent | 3d89db445d1f013a3abb250a1239199a23aae905 (diff) | |
download | bcm5719-llvm-a940f360cbaa1fb0da984c5cd311efe85a7d88ae.tar.gz bcm5719-llvm-a940f360cbaa1fb0da984c5cd311efe85a7d88ae.zip |
[AliasAnalysis] Give back AA results for fence instructions
Calling getModRefInfo with a fence resulted in crashes because fences
don't have a memory location. Add a new predicate to Instruction
called isFenceLike which indicates that the instruction mutates memory
but not any single memory location in particular. In practice, it is a
proxy for the set of instructions which "mayWriteToMemory" but cannot be
used with MemoryLocation::get.
This fixes PR28570.
llvm-svn: 275581
Diffstat (limited to 'llvm/lib/Analysis/AliasAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/AliasAnalysis.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/AliasAnalysis.cpp b/llvm/lib/Analysis/AliasAnalysis.cpp index ab5f814fb39..f931b6fc652 100644 --- a/llvm/lib/Analysis/AliasAnalysis.cpp +++ b/llvm/lib/Analysis/AliasAnalysis.cpp @@ -111,6 +111,9 @@ ModRefInfo AAResults::getModRefInfo(Instruction *I, ImmutableCallSite Call) { if (auto CS = ImmutableCallSite(I)) { // Check if the two calls modify the same memory return getModRefInfo(CS, Call); + } else if (I->isFenceLike()) { + // If this is a fence, just return MRI_ModRef. + return MRI_ModRef; } else { // Otherwise, check if the call modifies or references the // location this memory access defines. The best we can say |