Cuurently we always export STATEPOINT results (GC pointers lowered via VRegs)
to virtual registers. When processing gc.relocate instructions we have to
generate CopyFromRegs node and then export it to VReg again if gc.relocate
is used in other basic blocks. This results in generation of extra COPY MIR
instruction if statepoint and its gc.relocate are in same BB, but gc.relocate
result is used in other blocks.
This patch changes this behavior to export statepoint results only if used
in other basic blocks. It also records gc.relocate SDValue mapping for local
uses (it is equal to corresponding STATEPOINT result). Doing this gc.relocate
mapping in LowerStatepoint() allows to avoid complicated data structures which
need to be maintained across BB boundaries.
This is NFC and is purely compile time optimization. On big methids it can improve
codegen compile time up to 10%.
The idiomatic way to manipulate NodeMap is via setValue. Please use that.
See also comment about placement below.