summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/Loads.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2015-07-22 23:15:57 +0000
committerChandler Carruth <chandlerc@gmail.com>2015-07-22 23:15:57 +0000
commit194f59ca5d2f48f1e0b7fa95971ae9f88e95ba95 (patch)
tree67fa8610cb1dccceeb055c823d16d438fed256d5 /llvm/lib/Analysis/Loads.cpp
parent16fe4d178e9d81b07e8deb59a4b4292850364898 (diff)
downloadbcm5719-llvm-194f59ca5d2f48f1e0b7fa95971ae9f88e95ba95.tar.gz
bcm5719-llvm-194f59ca5d2f48f1e0b7fa95971ae9f88e95ba95.zip
[PM/AA] Extract the ModRef enums from the AliasAnalysis class in
preparation for de-coupling the AA implementations. In order to do this, they had to become fake-scoped using the traditional LLVM pattern of a leading initialism. These can't be actual scoped enumerations because they're bitfields and thus inherently we use them as integers. I've also renamed the behavior enums that are specific to reasoning about the mod/ref behavior of functions when called. This makes it more clear that they have a very narrow domain of applicability. I think there is a significantly cleaner API for all of this, but I don't want to try to do really substantive changes for now, I just want to refactor the things away from analysis groups so I'm preserving the exact original design and just cleaning up the names, style, and lifting out of the class. Differential Revision: http://reviews.llvm.org/D10564 llvm-svn: 242963
Diffstat (limited to 'llvm/lib/Analysis/Loads.cpp')
-rw-r--r--llvm/lib/Analysis/Loads.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/Loads.cpp b/llvm/lib/Analysis/Loads.cpp
index 624c5a18d67..4d6d960f159 100644
--- a/llvm/lib/Analysis/Loads.cpp
+++ b/llvm/lib/Analysis/Loads.cpp
@@ -246,9 +246,7 @@ Value *llvm::FindAvailableLoadedValue(Value *Ptr, BasicBlock *ScanBB,
// If we have alias analysis and it says the store won't modify the loaded
// value, ignore the store.
- if (AA &&
- (AA->getModRefInfo(SI, StrippedPtr, AccessSize) &
- AliasAnalysis::Mod) == 0)
+ if (AA && (AA->getModRefInfo(SI, StrippedPtr, AccessSize) & MRI_Mod) == 0)
continue;
// Otherwise the store that may or may not alias the pointer, bail out.
@@ -261,8 +259,7 @@ Value *llvm::FindAvailableLoadedValue(Value *Ptr, BasicBlock *ScanBB,
// If alias analysis claims that it really won't modify the load,
// ignore it.
if (AA &&
- (AA->getModRefInfo(Inst, StrippedPtr, AccessSize) &
- AliasAnalysis::Mod) == 0)
+ (AA->getModRefInfo(Inst, StrippedPtr, AccessSize) & MRI_Mod) == 0)
continue;
// May modify the pointer, bail out.
OpenPOWER on IntegriCloud