mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-19 04:29:21 +00: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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28950 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4ba6bf7458
commit
f299857496
@ -359,16 +359,28 @@ void AliasSetTracker::add(const AliasSetTracker &AST) {
|
|||||||
/// remove - Remove the specified (potentially non-empty) alias set from the
|
/// remove - Remove the specified (potentially non-empty) alias set from the
|
||||||
/// tracker.
|
/// tracker.
|
||||||
void AliasSetTracker::remove(AliasSet &AS) {
|
void AliasSetTracker::remove(AliasSet &AS) {
|
||||||
bool SetDead;
|
// Drop all call sites.
|
||||||
do {
|
AS.CallSites.clear();
|
||||||
AliasSet::iterator I = AS.begin();
|
|
||||||
Value *Ptr = I.getPointer(); ++I;
|
|
||||||
|
|
||||||
// deleteValue will delete the set automatically when the last pointer
|
// Clear the alias set.
|
||||||
// reference is destroyed. "Predict" when this will happen.
|
unsigned NumRefs = 0;
|
||||||
SetDead = I == AS.end();
|
while (!AS.empty()) {
|
||||||
deleteValue(Ptr); // Delete all of the pointers from the set
|
AliasSet::HashNodePair *P = AS.PtrList;
|
||||||
} while (!SetDead);
|
|
||||||
|
// Unlink from the list of values.
|
||||||
|
P->second.removeFromList();
|
||||||
|
|
||||||
|
// Remember how many references need to be dropped.
|
||||||
|
++NumRefs;
|
||||||
|
|
||||||
|
// 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) {
|
bool AliasSetTracker::remove(Value *Ptr, unsigned Size) {
|
||||||
|
Loading…
Reference in New Issue
Block a user