summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/AliasSetTracker.cpp
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2018-08-21 17:59:11 +0000
committerPhilip Reames <listmail@philipreames.com>2018-08-21 17:59:11 +0000
commitc3c23e8cf2d7cc593ec074b81d47f175a4874b67 (patch)
tree74f44cdf63fd03d1216163ccbb71bf241241ff67 /llvm/lib/Analysis/AliasSetTracker.cpp
parent63e7ab18e5e23bc3f5c72be47f07d5ebfef29167 (diff)
downloadbcm5719-llvm-c3c23e8cf2d7cc593ec074b81d47f175a4874b67.tar.gz
bcm5719-llvm-c3c23e8cf2d7cc593ec074b81d47f175a4874b67.zip
[AST] Remove notion of volatile from alias sets [NFCI]
Volatility is not an aliasing property. We used to model volatile as if it had extremely conservative aliasing implications, but that hasn't been true for several years now. So, it doesn't make sense to be in AliasSet. It also turns out the code is entirely a noop. Outside of the AST code to update it, there was only one user: load store promotion in LICM. L/S promotion doesn't need the check since it walks all the users of the address anyway. It already checks each load or store via !isUnordered which causes us to bail for volatile accesses. (Look at the lines immediately following the two remove asserts.) There is the possibility of some small compile time impact here, but the only case which will get noticeably slower is a loop with a large number of loads and stores to the same address where only the last one we inspect is volatile. This is sufficiently rare it's not worth optimizing for.. llvm-svn: 340312
Diffstat (limited to 'llvm/lib/Analysis/AliasSetTracker.cpp')
-rw-r--r--llvm/lib/Analysis/AliasSetTracker.cpp32
1 files changed, 8 insertions, 24 deletions
diff --git a/llvm/lib/Analysis/AliasSetTracker.cpp b/llvm/lib/Analysis/AliasSetTracker.cpp
index 0470247cf6c..dc6ecd58b7b 100644
--- a/llvm/lib/Analysis/AliasSetTracker.cpp
+++ b/llvm/lib/Analysis/AliasSetTracker.cpp
@@ -56,7 +56,6 @@ void AliasSet::mergeSetIn(AliasSet &AS, AliasSetTracker &AST) {
// Update the alias and access types of this set...
Access |= AS.Access;
Alias |= AS.Alias;
- Volatile |= AS.Volatile;
if (Alias == SetMustAlias) {
// Check that these two merged sets really are must aliases. Since both
@@ -365,15 +364,13 @@ void AliasSetTracker::add(Value *Ptr, LocationSize Size,
void AliasSetTracker::add(LoadInst *LI) {
if (isStrongerThanMonotonic(LI->getOrdering())) return addUnknown(LI);
- AliasSet &AS = addPointer(MemoryLocation::get(LI), AliasSet::RefAccess);
- if (LI->isVolatile()) AS.setVolatile();
+ addPointer(MemoryLocation::get(LI), AliasSet::RefAccess);
}
void AliasSetTracker::add(StoreInst *SI) {
if (isStrongerThanMonotonic(SI->getOrdering())) return addUnknown(SI);
- AliasSet &AS = addPointer(MemoryLocation::get(SI), AliasSet::ModAccess);
- if (SI->isVolatile()) AS.setVolatile();
+ addPointer(MemoryLocation::get(SI), AliasSet::ModAccess);
}
void AliasSetTracker::add(VAArgInst *VAAI) {
@@ -382,24 +379,15 @@ void AliasSetTracker::add(VAArgInst *VAAI) {
void AliasSetTracker::add(AnyMemSetInst *MSI) {
auto MemLoc = MemoryLocation::getForDest(MSI);
- AliasSet &AS = addPointer(MemLoc, AliasSet::ModAccess);
- auto *MS = dyn_cast<MemSetInst>(MSI);
- if (MS && MS->isVolatile())
- AS.setVolatile();
+ addPointer(MemLoc, AliasSet::ModAccess);
}
void AliasSetTracker::add(AnyMemTransferInst *MTI) {
auto SrcLoc = MemoryLocation::getForSource(MTI);
- AliasSet &ASSrc = addPointer(SrcLoc, AliasSet::RefAccess);
+ addPointer(SrcLoc, AliasSet::RefAccess);
auto DestLoc = MemoryLocation::getForDest(MTI);
- AliasSet &ASDst = addPointer(DestLoc, AliasSet::ModAccess);
-
- auto* MT = dyn_cast<MemTransferInst>(MTI);
- if (MT && MT->isVolatile()) {
- ASSrc.setVolatile();
- ASDst.setVolatile();
- }
+ addPointer(DestLoc, AliasSet::ModAccess);
}
void AliasSetTracker::addUnknown(Instruction *Inst) {
@@ -468,12 +456,9 @@ void AliasSetTracker::add(const AliasSetTracker &AST) {
add(Inst);
// Loop over all of the pointers in this alias set.
- for (AliasSet::iterator ASI = AS.begin(), E = AS.end(); ASI != E; ++ASI) {
- AliasSet &NewAS =
- addPointer(ASI.getPointer(), ASI.getSize(), ASI.getAAInfo(),
- (AliasSet::AccessLattice)AS.Access);
- if (AS.isVolatile()) NewAS.setVolatile();
- }
+ for (AliasSet::iterator ASI = AS.begin(), E = AS.end(); ASI != E; ++ASI)
+ addPointer(ASI.getPointer(), ASI.getSize(), ASI.getAAInfo(),
+ (AliasSet::AccessLattice)AS.Access);
}
}
@@ -595,7 +580,6 @@ void AliasSet::print(raw_ostream &OS) const {
case ModRefAccess: OS << "Mod/Ref "; break;
default: llvm_unreachable("Bad value for Access!");
}
- if (isVolatile()) OS << "[volatile] ";
if (Forward)
OS << " forwarding to " << (void*)Forward;
OpenPOWER on IntegriCloud