mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 19:52:54 +01:00
Don't implement AliasSetTracker::remove in terms of deleteValue. deleteValue
causes the pointer to be removed from the underlying alias analysis implementation as well. This impl of remove is also significantly faster than the old one. This fixes: Regression/Transforms/DeadStoreElimination/2006-06-27-AST-Remove.ll llvm-svn: 28950
This commit is contained in:
parent
3ec808d0a9
commit
a3a29d82b6
@ -359,16 +359,28 @@ void AliasSetTracker::add(const AliasSetTracker &AST) {
|
||||
/// remove - Remove the specified (potentially non-empty) alias set from the
|
||||
/// tracker.
|
||||
void AliasSetTracker::remove(AliasSet &AS) {
|
||||
bool SetDead;
|
||||
do {
|
||||
AliasSet::iterator I = AS.begin();
|
||||
Value *Ptr = I.getPointer(); ++I;
|
||||
// Drop all call sites.
|
||||
AS.CallSites.clear();
|
||||
|
||||
// Clear the alias set.
|
||||
unsigned NumRefs = 0;
|
||||
while (!AS.empty()) {
|
||||
AliasSet::HashNodePair *P = AS.PtrList;
|
||||
|
||||
// Unlink from the list of values.
|
||||
P->second.removeFromList();
|
||||
|
||||
// Remember how many references need to be dropped.
|
||||
++NumRefs;
|
||||
|
||||
// deleteValue will delete the set automatically when the last pointer
|
||||
// reference is destroyed. "Predict" when this will happen.
|
||||
SetDead = I == AS.end();
|
||||
deleteValue(Ptr); // Delete all of the pointers from the set
|
||||
} while (!SetDead);
|
||||
// Finally, remove the entry.
|
||||
PointerMap.erase(P->first);
|
||||
}
|
||||
|
||||
// Stop using the alias set, removing it.
|
||||
assert(AS.RefCount == NumRefs);
|
||||
AS.RefCount = 0;
|
||||
AS.removeFromTracker(*this);
|
||||
}
|
||||
|
||||
bool AliasSetTracker::remove(Value *Ptr, unsigned Size) {
|
||||
|
Loading…
Reference in New Issue
Block a user