[llvm] r278365 - [AliasSetTracker] Delete dead code
Michael Kuperstein via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 11 10:20:20 PDT 2016
Author: mkuper
Date: Thu Aug 11 12:20:20 2016
New Revision: 278365
URL: http://llvm.org/viewvc/llvm-project?rev=278365&view=rev
Log:
[AliasSetTracker] Delete dead code
Deletes unused remove() and containsPointer() interfaces. NFC.
Differential Revision: https://reviews.llvm.org/D23360
Modified:
llvm/trunk/include/llvm/Analysis/AliasSetTracker.h
llvm/trunk/lib/Analysis/AliasSetTracker.cpp
Modified: llvm/trunk/include/llvm/Analysis/AliasSetTracker.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasSetTracker.h?rev=278365&r1=278364&r2=278365&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/AliasSetTracker.h (original)
+++ llvm/trunk/include/llvm/Analysis/AliasSetTracker.h Thu Aug 11 12:20:20 2016
@@ -342,18 +342,6 @@ public:
void add(const AliasSetTracker &AST); // Add alias relations from another AST
bool addUnknown(Instruction *I);
- /// These methods are used to remove all entries that might be aliased by the
- /// specified instruction. These methods return true if any alias sets were
- /// eliminated.
- bool remove(Value *Ptr, uint64_t Size, const AAMDNodes &AAInfo);
- bool remove(LoadInst *LI);
- bool remove(StoreInst *SI);
- bool remove(VAArgInst *VAAI);
- bool remove(MemSetInst *MSI);
- bool remove(Instruction *I);
- void remove(AliasSet &AS);
- bool removeUnknown(Instruction *I);
-
void clear();
/// Return the alias sets that are active.
@@ -374,11 +362,6 @@ public:
return mergeAliasSetsForPointer(P, Size, AAInfo);
}
- /// Return true if the specified location is represented by this alias set,
- /// false otherwise. This does not modify the AST object or alias sets.
- bool containsPointer(const Value *P, uint64_t Size,
- const AAMDNodes &AAInfo) const;
-
/// Return true if the specified instruction "may" (or must) alias one of the
/// members in any of the sets.
bool containsUnknown(const Instruction *I) const;
Modified: llvm/trunk/lib/Analysis/AliasSetTracker.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasSetTracker.cpp?rev=278365&r1=278364&r2=278365&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/AliasSetTracker.cpp (original)
+++ llvm/trunk/lib/Analysis/AliasSetTracker.cpp Thu Aug 11 12:20:20 2016
@@ -229,17 +229,6 @@ AliasSet *AliasSetTracker::mergeAliasSet
return FoundSet;
}
-/// containsPointer - Return true if the specified location is represented by
-/// this alias set, false otherwise. This does not modify the AST object or
-/// alias sets.
-bool AliasSetTracker::containsPointer(const Value *Ptr, uint64_t Size,
- const AAMDNodes &AAInfo) const {
- for (const AliasSet &AS : *this)
- if (!AS.Forward && AS.aliasesPointer(Ptr, Size, AAInfo, AA))
- return true;
- return false;
-}
-
bool AliasSetTracker::containsUnknown(const Instruction *Inst) const {
for (const AliasSet &AS : *this)
if (!AS.Forward && AS.aliasesUnknownInst(Inst, AA))
@@ -428,124 +417,6 @@ void AliasSetTracker::add(const AliasSet
}
}
-/// remove - Remove the specified (potentially non-empty) alias set from the
-/// tracker.
-void AliasSetTracker::remove(AliasSet &AS) {
- // Drop all call sites.
- if (!AS.UnknownInsts.empty())
- AS.dropRef(*this);
- AS.UnknownInsts.clear();
-
- // Clear the alias set.
- unsigned NumRefs = 0;
- while (!AS.empty()) {
- AliasSet::PointerRec *P = AS.PtrList;
-
- Value *ValToRemove = P->getValue();
-
- // Unlink and delete entry from the list of values.
- P->eraseFromList();
-
- // Remember how many references need to be dropped.
- ++NumRefs;
-
- // Finally, remove the entry.
- PointerMap.erase(ValToRemove);
- }
-
- // Stop using the alias set, removing it.
- AS.RefCount -= NumRefs;
- if (AS.RefCount == 0)
- AS.removeFromTracker(*this);
-}
-
-bool
-AliasSetTracker::remove(Value *Ptr, uint64_t Size, const AAMDNodes &AAInfo) {
- AliasSet *AS = mergeAliasSetsForPointer(Ptr, Size, AAInfo);
- if (!AS) return false;
- remove(*AS);
- return true;
-}
-
-bool AliasSetTracker::remove(LoadInst *LI) {
- const DataLayout &DL = LI->getModule()->getDataLayout();
- uint64_t Size = DL.getTypeStoreSize(LI->getType());
-
- AAMDNodes AAInfo;
- LI->getAAMetadata(AAInfo);
-
- AliasSet *AS = mergeAliasSetsForPointer(LI->getOperand(0), Size, AAInfo);
- if (!AS) return false;
- remove(*AS);
- return true;
-}
-
-bool AliasSetTracker::remove(StoreInst *SI) {
- const DataLayout &DL = SI->getModule()->getDataLayout();
- uint64_t Size = DL.getTypeStoreSize(SI->getOperand(0)->getType());
-
- AAMDNodes AAInfo;
- SI->getAAMetadata(AAInfo);
-
- AliasSet *AS = mergeAliasSetsForPointer(SI->getOperand(1), Size, AAInfo);
- if (!AS) return false;
- remove(*AS);
- return true;
-}
-
-bool AliasSetTracker::remove(VAArgInst *VAAI) {
- AAMDNodes AAInfo;
- VAAI->getAAMetadata(AAInfo);
-
- AliasSet *AS = mergeAliasSetsForPointer(VAAI->getOperand(0),
- MemoryLocation::UnknownSize, AAInfo);
- if (!AS) return false;
- remove(*AS);
- return true;
-}
-
-bool AliasSetTracker::remove(MemSetInst *MSI) {
- AAMDNodes AAInfo;
- MSI->getAAMetadata(AAInfo);
- uint64_t Len;
-
- if (ConstantInt *C = dyn_cast<ConstantInt>(MSI->getLength()))
- Len = C->getZExtValue();
- else
- Len = MemoryLocation::UnknownSize;
-
- AliasSet *AS = mergeAliasSetsForPointer(MSI->getRawDest(), Len, AAInfo);
- if (!AS)
- return false;
- remove(*AS);
- return true;
-}
-
-bool AliasSetTracker::removeUnknown(Instruction *I) {
- if (!I->mayReadOrWriteMemory())
- return false; // doesn't alias anything
-
- AliasSet *AS = findAliasSetForUnknownInst(I);
- if (!AS) return false;
- remove(*AS);
- return true;
-}
-
-bool AliasSetTracker::remove(Instruction *I) {
- // Dispatch to one of the other remove methods...
- if (LoadInst *LI = dyn_cast<LoadInst>(I))
- return remove(LI);
- if (StoreInst *SI = dyn_cast<StoreInst>(I))
- return remove(SI);
- if (VAArgInst *VAAI = dyn_cast<VAArgInst>(I))
- return remove(VAAI);
- if (MemSetInst *MSI = dyn_cast<MemSetInst>(I))
- return remove(MSI);
- return removeUnknown(I);
- // FIXME: add support of memcpy and memmove.
-}
-
-
// deleteValue method - This method is used to remove a pointer value from the
// AliasSetTracker entirely. It should be used when an instruction is deleted
// from the program to update the AST. If you don't use this, you would have
More information about the llvm-commits
mailing list