[llvm] r322298 - [Hexagon] Use SetVector when queuing nodes to scan in selectVectorConstants

Krzysztof Parzyszek via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 11 09:59:35 PST 2018


Author: kparzysz
Date: Thu Jan 11 09:59:34 2018
New Revision: 322298

URL: http://llvm.org/viewvc/llvm-project?rev=322298&view=rev
Log:
[Hexagon] Use SetVector when queuing nodes to scan in selectVectorConstants

Modified:
    llvm/trunk/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp

Modified: llvm/trunk/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp?rev=322298&r1=322297&r2=322298&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp Thu Jan 11 09:59:34 2018
@@ -11,6 +11,7 @@
 #include "HexagonISelDAGToDAG.h"
 #include "HexagonISelLowering.h"
 #include "HexagonTargetMachine.h"
+#include "llvm/ADT/SetVector.h"
 #include "llvm/CodeGen/MachineInstrBuilder.h"
 #include "llvm/CodeGen/SelectionDAGISel.h"
 #include "llvm/IR/Intrinsics.h"
@@ -909,7 +910,7 @@ bool HvxSelector::selectVectorConstants(
   // selection algorithm is not aware of them. Select them directly
   // here.
   SmallVector<SDNode*,4> Loads;
-  SmallVector<SDNode*,16> WorkQ;
+  SetVector<SDNode*> WorkQ;
 
   // The DAG can change (due to CSE) during selection, so cache all the
   // unselected nodes first to avoid traversing a mutating DAG.
@@ -925,7 +926,7 @@ bool HvxSelector::selectVectorConstants(
     return false;
   };
 
-  WorkQ.push_back(N);
+  WorkQ.insert(N);
   for (unsigned i = 0; i != WorkQ.size(); ++i) {
     SDNode *W = WorkQ[i];
     if (IsLoadToSelect(W)) {
@@ -933,7 +934,7 @@ bool HvxSelector::selectVectorConstants(
       continue;
     }
     for (unsigned j = 0, f = W->getNumOperands(); j != f; ++j)
-      WorkQ.push_back(W->getOperand(j).getNode());
+      WorkQ.insert(W->getOperand(j).getNode());
   }
 
   for (SDNode *L : Loads)




More information about the llvm-commits mailing list