[llvm] r277027 - Fix DbgValue handling in SelectionDAG.

Nirav Dave via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 28 12:48:39 PDT 2016


Author: niravd
Date: Thu Jul 28 14:48:39 2016
New Revision: 277027

URL: http://llvm.org/viewvc/llvm-project?rev=277027&view=rev
Log:
Fix DbgValue handling in SelectionDAG.

[DAG] Relocate TransferDbgValues in ReplaceAllUsesWith(SDValue, SDValue)
to before we modify the CSE maps.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=277027&r1=277026&r2=277027&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Thu Jul 28 14:48:39 2016
@@ -6255,6 +6255,9 @@ void SelectionDAG::ReplaceAllUsesWith(SD
          "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(SD
     AddModifiedNodeToCSEMaps(User);
   }
 
-  // Preserve Debug Values
-  TransferDbgValues(FromN, To);
 
   // If we just RAUW'd the root, take note.
   if (FromN == getRoot())




More information about the llvm-commits mailing list