diff options
author | Nirav Dave <niravd@google.com> | 2016-07-28 19:48:39 +0000 |
---|---|---|
committer | Nirav Dave <niravd@google.com> | 2016-07-28 19:48:39 +0000 |
commit | b7c72717c92e3d7260bfe8aebc110971b32bf097 (patch) | |
tree | afafae27f614b8b33975392af5156d9d268c466a /llvm/lib/CodeGen/SelectionDAG | |
parent | 6c9dbbd661b9b9dacc16e8c3ba987089b50adda7 (diff) | |
download | bcm5719-llvm-b7c72717c92e3d7260bfe8aebc110971b32bf097.tar.gz bcm5719-llvm-b7c72717c92e3d7260bfe8aebc110971b32bf097.zip |
Fix DbgValue handling in SelectionDAG.
[DAG] Relocate TransferDbgValues in ReplaceAllUsesWith(SDValue, SDValue)
to before we modify the CSE maps.
llvm-svn: 277027
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index cfbd3101b90..08b87b93a2f 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -6255,6 +6255,9 @@ void SelectionDAG::ReplaceAllUsesWith(SDValue FromN, SDValue To) { "Cannot replace with this method!"); assert(From != To.getNode() && "Cannot replace uses of with self"); + // Preserve Debug Values + TransferDbgValues(FromN, To); + // Iterate over all the existing uses of From. New uses will be added // to the beginning of the use list, which we avoid visiting. // This specifically avoids visiting uses of From that arise while the @@ -6285,8 +6288,6 @@ void SelectionDAG::ReplaceAllUsesWith(SDValue FromN, SDValue To) { AddModifiedNodeToCSEMaps(User); } - // Preserve Debug Values - TransferDbgValues(FromN, To); // If we just RAUW'd the root, take note. if (FromN == getRoot()) |