When replacing a node and its operand, replacing the operand node may
cause the deletion of the original node leading to an assertion
failure. Case around these replacements to avoid this without relying
on inspecting the opcode of deleted nodes in various
DAGCombiner rewrites dealing with value extensions.
Fixes PR32515.
Not sure if its relevant but there are several other places that call deleteAndRecombine on a node under similar circumstances.