Agreed, I’ve added RAUW support in the current patch. The listener is now renamed to InstructionListener (since it covers more than just deletion) and accepts an optional RAUW callback:
InstructionListener(Function &F, CallbackT CB, RAUWCallbackT RAUWCB = nullptr);
The RAUW hook is placed in Value::doRAUW() with a guard that only fires for Instructions attached to a function with listeners — same pattern as the deletion hook in setParent(nullptr).
To validate the impact: I prototyped replacing SCEVCallbackVH in ScalarEvolution with a single InstructionListener. The deleted() callback maps to the deletion hook, and allUsesReplacedWith() maps to the RAUW hook. This eliminates O(N) per-value handle registrations and replaces them with one per-function listener — all existing SCEV tests pass. The same pattern applies to any analysis that caches Instruction.
If required I will push the changes added in SCEV to replace callbackVH with listener in separate PR.