[SelectionDAG] Transitively copy NodeExtraInfo on RAUW
authorMarco Elver <elver@google.com>
Mon, 27 Feb 2023 11:05:02 +0000 (12:05 +0100)
committerMarco Elver <elver@google.com>
Mon, 27 Feb 2023 11:16:14 +0000 (12:16 +0100)
commit7f635b90e7bdf1378fd9a65fc62b99e8e07d4aaf
treec9b141698028354027eef871404c42ae6703530e
parentd73da86812137312e559e2b01a88f16f1896968e
[SelectionDAG] Transitively copy NodeExtraInfo on RAUW

During legalization of the SelectionDAG, some nodes are replaced with
arch-specific nodes. These may be complex nodes, where the root node no
longer corresponds to the node that should carry the extra info.

Fix the issue by copying extra info to the new node and all its new
transitive operands during RAUW. See code comments for more details.

This fixes the remaining pcsections-atomics.ll tests on X86.

Reviewed By: dvyukov

Differential Revision: https://reviews.llvm.org/D144677
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
llvm/test/CodeGen/X86/pcsections-atomics.ll