Index: include/llvm/Analysis/AliasSetTracker.h =================================================================== --- include/llvm/Analysis/AliasSetTracker.h +++ include/llvm/Analysis/AliasSetTracker.h @@ -175,9 +175,6 @@ }; unsigned Alias : 1; - /// True if this alias set contains volatile loads or stores. - unsigned Volatile : 1; - unsigned SetSize = 0; void addRef() { ++RefCount; } @@ -203,9 +200,6 @@ bool isMustAlias() const { return Alias == SetMustAlias; } bool isMayAlias() const { return Alias == SetMayAlias; } - /// Return true if this alias set contains volatile loads or stores. - bool isVolatile() const { return Volatile; } - /// Return true if this alias set should be ignored as part of the /// AliasSetTracker object. bool isForwardingAliasSet() const { return Forward; } @@ -278,7 +272,7 @@ // Can only be created by AliasSetTracker. AliasSet() : PtrListEnd(&PtrList), RefCount(0), AliasAny(false), Access(NoAccess), - Alias(SetMustAlias), Volatile(false) {} + Alias(SetMustAlias) {} PointerRec *getSomePointer() const { return PtrList; @@ -317,8 +311,6 @@ dropRef(AST); } - void setVolatile() { Volatile = true; } - public: /// Return true if the specified pointer "may" (or must) alias one of the /// members in the set. Index: lib/Analysis/AliasSetTracker.cpp =================================================================== --- lib/Analysis/AliasSetTracker.cpp +++ lib/Analysis/AliasSetTracker.cpp @@ -56,7 +56,6 @@ // 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,14 +364,12 @@ if (isStrongerThanMonotonic(LI->getOrdering())) return addUnknown(LI); AliasSet &AS = addPointer(MemoryLocation::get(LI), AliasSet::RefAccess); - if (LI->isVolatile()) AS.setVolatile(); } 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(); } void AliasSetTracker::add(VAArgInst *VAAI) { @@ -383,8 +380,6 @@ auto MemLoc = MemoryLocation::getForDest(MSI); AliasSet &AS = addPointer(MemLoc, AliasSet::ModAccess); auto *MS = dyn_cast(MSI); - if (MS && MS->isVolatile()) - AS.setVolatile(); } void AliasSetTracker::add(AnyMemTransferInst *MTI) { @@ -395,10 +390,6 @@ AliasSet &ASDst = addPointer(DestLoc, AliasSet::ModAccess); auto* MT = dyn_cast(MTI); - if (MT && MT->isVolatile()) { - ASSrc.setVolatile(); - ASDst.setVolatile(); - } } void AliasSetTracker::addUnknown(Instruction *Inst) { @@ -471,7 +462,6 @@ AliasSet &NewAS = addPointer(ASI.getPointer(), ASI.getSize(), ASI.getAAInfo(), (AliasSet::AccessLattice)AS.Access); - if (AS.isVolatile()) NewAS.setVolatile(); } } } @@ -594,7 +584,6 @@ case ModRefAccess: OS << "Mod/Ref "; break; default: llvm_unreachable("Bad value for Access!"); } - if (isVolatile()) OS << "[volatile] "; if (Forward) OS << " forwarding to " << (void*)Forward; Index: lib/Transforms/Scalar/LICM.cpp =================================================================== --- lib/Transforms/Scalar/LICM.cpp +++ lib/Transforms/Scalar/LICM.cpp @@ -321,7 +321,7 @@ // alias set, if the pointer is loop invariant, and if we are not // eliminating any volatile loads or stores. if (AS.isForwardingAliasSet() || !AS.isMod() || !AS.isMustAlias() || - AS.isVolatile() || !L->isLoopInvariant(AS.begin()->getValue())) + !L->isLoopInvariant(AS.begin()->getValue())) continue; assert( @@ -1351,7 +1351,6 @@ // If there is an non-load/store instruction in the loop, we can't promote // it. if (LoadInst *Load = dyn_cast(UI)) { - assert(!Load->isVolatile() && "AST broken"); if (!Load->isUnordered()) return false; @@ -1366,7 +1365,6 @@ // pointer. if (UI->getOperand(1) != ASIV) continue; - assert(!Store->isVolatile() && "AST broken"); if (!Store->isUnordered()) return false; Index: test/Analysis/AliasSet/memtransfer.ll =================================================================== --- test/Analysis/AliasSet/memtransfer.ll +++ test/Analysis/AliasSet/memtransfer.ll @@ -61,7 +61,7 @@ ; CHECK: Alias Set Tracker: 3 alias sets for 4 pointer values. ; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod Pointers: (i8* %a, 1) ; CHECK-NOT: 1 Unknown instructions -; CHECK: AliasSet[0x{{[0-9a-f]+}}, 2] may alias, Mod/Ref [volatile] Pointers: (i8* %s, 1), (i8* %d, 1) +; CHECK: AliasSet[0x{{[0-9a-f]+}}, 2] may alias, Mod/Ref Pointers: (i8* %s, 1), (i8* %d, 1) ; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod Pointers: (i8* %b, 1) define void @test2(i8* %s, i8* %d) { entry: @@ -109,7 +109,7 @@ ; CHECK: Alias Set Tracker: 3 alias sets for 4 pointer values. ; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod Pointers: (i8* %a, 1) ; CHECK-NOT: 1 Unknown instructions -; CHECK: AliasSet[0x{{[0-9a-f]+}}, 2] may alias, Mod/Ref [volatile] Pointers: (i8* %s, 1), (i8* %d, 1) +; CHECK: AliasSet[0x{{[0-9a-f]+}}, 2] may alias, Mod/Ref Pointers: (i8* %s, 1), (i8* %d, 1) ; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod Pointers: (i8* %b, 1) define void @test4(i8* %s, i8* %d) { entry: