[rs4gc] Simplify code by cloning existing instructions when inserting base chain...
authorPhilip Reames <listmail@philipreames.com>
Tue, 16 Mar 2021 20:00:23 +0000 (13:00 -0700)
committerPhilip Reames <listmail@philipreames.com>
Tue, 16 Mar 2021 20:10:32 +0000 (13:10 -0700)
commitcec9e7352bebe06681a9627f3fc08228129b7681
tree558214a28fda71279dbe2349b391a64be78f1a51
parentef884e155da7a46225f3441faa45d6d9e4249f8d
[rs4gc] Simplify code by cloning existing instructions when inserting base chain [NFC]

Previously we created a new node, then filled in the pieces. Now, we clone the existing node, then change the respective fields. The only change in handling is with phis since we have to handle multiple incoming edges from the same block a bit differently.

Differential Revision: https://reviews.llvm.org/D98316
llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp