Support the case where an operand of a pattern is also the whole of the
result pattern. In this case the original result and all its uses must be
replaced by the operand. However, register class restrictions can require
a COPY. This patch handles both cases by always emitting the copy and
leaving it for the register allocator to optimize.
Depends on D35833
Can you point out those rules? The comments in SelectionDAGCompat say that G_INTTOPTR has no SelectionDAG equivalent, so I'm not sure where to look.