[llvm] r338079 - [DAGCombiner] Remove some calls to AddToWorklist that should be unnecessary.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 26 15:40:22 PDT 2018


Author: ctopper
Date: Thu Jul 26 15:40:22 2018
New Revision: 338079

URL: http://llvm.org/viewvc/llvm-project?rev=338079&view=rev
Log:
[DAGCombiner] Remove some calls to AddToWorklist that should be unnecessary.

The DAGCombiner has a system for ensuring all nodes are visited. It doesn't require an AddToWorkList for every node that is created by a combine.

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=338079&r1=338078&r2=338079&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Thu Jul 26 15:40:22 2018
@@ -2856,11 +2856,8 @@ SDValue DAGCombiner::visitMUL(SDNode *N)
       (!VT.isVector() || Level <= AfterLegalizeVectorOps)) {
     SDLoc DL(N);
     SDValue LogBase2 = BuildLogBase2(N1, DL);
-    AddToWorklist(LogBase2.getNode());
-
     EVT ShiftVT = getShiftAmountTy(N0.getValueType());
     SDValue Trunc = DAG.getZExtOrTrunc(LogBase2, DL, ShiftVT);
-    AddToWorklist(Trunc.getNode());
     return DAG.getNode(ISD::SHL, DL, VT, N0, Trunc);
   }
   // fold (mul x, -(1 << c)) -> -(x << c) or (-x) << c




More information about the llvm-commits mailing list