new nodes should be added to the worklist, not old nodes.
authorChris Lattner <sabre@nondot.org>
Fri, 16 Jan 2009 21:15:56 +0000 (21:15 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 16 Jan 2009 21:15:56 +0000 (21:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62359 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/DAGCombiner.cpp

index 8b984665be0298534bdff4cf855ff4acc681921b..46c62ca56bdbacda53439c2663aac77b85608cea 100644 (file)
@@ -3358,7 +3358,7 @@ SDValue DAGCombiner::ReduceLoadWidth(SDNode *N) {
       : DAG.getExtLoad(ExtType, VT, LN0->getChain(), NewPtr,
                        LN0->getSrcValue(), LN0->getSrcValueOffset() + PtrOff,
                        EVT, LN0->isVolatile(), NewAlign);
-    AddToWorkList(N);
+    AddToWorkList(Load.Node);
     if (CombineSRL) {
       WorkListRemover DeadNodes(*this);
       DAG.ReplaceAllUsesOfValueWith(N0.getValue(1), Load.getValue(1),
@@ -3366,6 +3366,7 @@ SDValue DAGCombiner::ReduceLoadWidth(SDNode *N) {
       CombineTo(N->getOperand(0).getNode(), Load);
     } else
       CombineTo(N0.getNode(), Load, Load.getValue(1));
+    
     if (ShAmt) {
       if (Opc == ISD::SIGN_EXTEND_INREG)
         return DAG.getNode(Opc, VT, Load, N->getOperand(1));