mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
Revert r122114 (CallbackVH observing use-list changes) because it caused severe slowdowns on the Linux self-host configuration.
llvm-svn: 122279
This commit is contained in:
parent
c7dfecb10e
commit
c1eee5ac49
@ -105,7 +105,6 @@ private:
|
|||||||
// Callbacks made from Value.
|
// Callbacks made from Value.
|
||||||
static void ValueIsDeleted(Value *V);
|
static void ValueIsDeleted(Value *V);
|
||||||
static void ValueIsRAUWd(Value *Old, Value *New);
|
static void ValueIsRAUWd(Value *Old, Value *New);
|
||||||
static void ValueAddedUse(Use &U);
|
|
||||||
|
|
||||||
// Internal implementation details.
|
// Internal implementation details.
|
||||||
ValueHandleBase **getPrevPtr() const { return PrevPair.getPointer(); }
|
ValueHandleBase **getPrevPtr() const { return PrevPair.getPointer(); }
|
||||||
@ -390,11 +389,6 @@ public:
|
|||||||
/// implemented as a CallbackVH, it would use this method to call
|
/// implemented as a CallbackVH, it would use this method to call
|
||||||
/// setValPtr(new_value). AssertingVH would do nothing in this method.
|
/// setValPtr(new_value). AssertingVH would do nothing in this method.
|
||||||
virtual void allUsesReplacedWith(Value *) {}
|
virtual void allUsesReplacedWith(Value *) {}
|
||||||
|
|
||||||
/// Called when a new Use is added to the use-list of this->getValPtr(),
|
|
||||||
/// after the Use has been appended to the list. Other VH kinds would ignore
|
|
||||||
/// this callback, but clients can use it to trigger re-analysis of Values.
|
|
||||||
virtual void addedUse(Use &) {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Specialize simplify_type to allow CallbackVH to participate in
|
// Specialize simplify_type to allow CallbackVH to participate in
|
||||||
|
@ -195,7 +195,7 @@ public:
|
|||||||
|
|
||||||
/// addUse - This method should only be used by the Use class.
|
/// addUse - This method should only be used by the Use class.
|
||||||
///
|
///
|
||||||
void addUse(Use &U);
|
void addUse(Use &U) { U.addToList(&UseList); }
|
||||||
|
|
||||||
/// An enumeration for keeping track of the concrete subclass of Value that
|
/// An enumeration for keeping track of the concrete subclass of Value that
|
||||||
/// is actually instantiated. Values of this enumeration are kept in the
|
/// is actually instantiated. Values of this enumeration are kept in the
|
||||||
|
@ -281,16 +281,6 @@ void Value::takeName(Value *V) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// addUse - This method should only be used by the Use class.
|
|
||||||
///
|
|
||||||
void Value::addUse(Use &U) {
|
|
||||||
U.addToList(&UseList);
|
|
||||||
|
|
||||||
// Notify all ValueHandles (if present) that this value added a Use.
|
|
||||||
if (HasValueHandle)
|
|
||||||
ValueHandleBase::ValueAddedUse(U);
|
|
||||||
}
|
|
||||||
|
|
||||||
// uncheckedReplaceAllUsesWith - This is exactly the same as replaceAllUsesWith,
|
// uncheckedReplaceAllUsesWith - This is exactly the same as replaceAllUsesWith,
|
||||||
// except that it doesn't have all of the asserts. The asserts fail because we
|
// except that it doesn't have all of the asserts. The asserts fail because we
|
||||||
// are half-way done resolving types, which causes some types to exist as two
|
// are half-way done resolving types, which causes some types to exist as two
|
||||||
@ -579,34 +569,6 @@ void ValueHandleBase::ValueIsDeleted(Value *V) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ValueHandleBase::ValueAddedUse(Use &U) {
|
|
||||||
assert(U->HasValueHandle && "Should only be called if ValueHandles present");
|
|
||||||
|
|
||||||
// Get the linked list base, which is guaranteed to exist since the
|
|
||||||
// HasValueHandle flag is set.
|
|
||||||
LLVMContextImpl *pImpl = U->getContext().pImpl;
|
|
||||||
ValueHandleBase *Entry = pImpl->ValueHandles[U.get()];
|
|
||||||
|
|
||||||
assert(Entry && "Value bit set but no entries exist");
|
|
||||||
|
|
||||||
// We use a local ValueHandleBase as an iterator so that
|
|
||||||
// ValueHandles can add and remove themselves from the list without
|
|
||||||
// breaking our iteration. This is not really an AssertingVH; we
|
|
||||||
// just have to give ValueHandleBase some kind.
|
|
||||||
for (ValueHandleBase Iterator(Assert, *Entry); Entry; Entry = Iterator.Next) {
|
|
||||||
Iterator.RemoveFromUseList();
|
|
||||||
Iterator.AddToExistingUseListAfter(Entry);
|
|
||||||
assert(Entry->Next == &Iterator && "Loop invariant broken.");
|
|
||||||
|
|
||||||
switch (Entry->getKind()) {
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
case Callback:
|
|
||||||
static_cast<CallbackVH*>(Entry)->addedUse(U);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ValueHandleBase::ValueIsRAUWd(Value *Old, Value *New) {
|
void ValueHandleBase::ValueIsRAUWd(Value *Old, Value *New) {
|
||||||
assert(Old->HasValueHandle &&"Should only be called if ValueHandles present");
|
assert(Old->HasValueHandle &&"Should only be called if ValueHandles present");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user