[llvm] r310659 - Revert "[DAG] Cleanup unused nodes after store merge. NFCI."

Nirav Dave via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 10 14:03:37 PDT 2017


Author: niravd
Date: Thu Aug 10 14:03:36 2017
New Revision: 310659

URL: http://llvm.org/viewvc/llvm-project?rev=310659&view=rev
Log:
Revert "[DAG] Cleanup unused nodes after store merge. NFCI."

This reverts commit r310648 which causes an unexpected assertion failure

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

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=310659&r1=310658&r2=310659&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Thu Aug 10 14:03:36 2017
@@ -12590,15 +12590,8 @@ bool DAGCombiner::MergeStoresOfConstants
   }
 
   // Replace all merged stores with the new store.
-  for (unsigned i = 0; i < NumStores; ++i) {
-    SDValue Val = StoreNodes[i].MemNode->getOperand(1);
-    SDValue Addr = StoreNodes[i].MemNode->getOperand(2);
+  for (unsigned i = 0; i < NumStores; ++i)
     CombineTo(StoreNodes[i].MemNode, NewStore);
-    if (Val.getNode()->use_empty())
-      recursivelyDeleteUnusedNodes(Val.getNode());
-    if (Addr.getNode()->use_empty())
-      recursivelyDeleteUnusedNodes(Addr.getNode());
-  }
 
   AddToWorklist(NewChain.getNode());
   return true;
@@ -13233,12 +13226,9 @@ bool DAGCombiner::MergeConsecutiveStores
     // corresponding value if its no longer used.
     for (unsigned i = 0; i < NumElem; ++i) {
       SDValue Val = StoreNodes[i].MemNode->getOperand(1);
-      SDValue Addr = StoreNodes[i].MemNode->getOperand(2);
       CombineTo(StoreNodes[i].MemNode, NewStore);
       if (Val.getNode()->use_empty())
         recursivelyDeleteUnusedNodes(Val.getNode());
-      if (Addr.getNode()->use_empty())
-        recursivelyDeleteUnusedNodes(Addr.getNode());
     }
 
     RV = true;




More information about the llvm-commits mailing list