From 0b2ce1fc19c5f8742051cf022ac119a3d4d9a3ad Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Fri, 22 Jun 2007 01:35:51 +0000 Subject: [PATCH] std::set is really really terrible. Switch to SmallPtrSet to reduce compile time. For Duraid's example. The overall isel time is reduced from 0.6255 sec to 0.1876 sec. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37701 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp index 08292bb6e4d..dcdb9615cc6 100644 --- a/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp +++ b/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp @@ -118,7 +118,7 @@ void ScheduleDAGRRList::Schedule() { /// it is not the last use of its first operand, add it to the CommuteSet if /// possible. It will be commuted when it is translated to a MI. void ScheduleDAGRRList::CommuteNodesToReducePressure() { - std::set OperandSeen; + SmallPtrSet OperandSeen; for (unsigned i = Sequence.size()-1; i != 0; --i) { // Ignore first node. SUnit *SU = Sequence[i]; if (!SU) continue; @@ -680,13 +680,13 @@ bool bu_ls_rr_sort::operator()(const SUnit *left, const SUnit *right) const { // FIXME: This is probably too slow! static void isReachable(SUnit *SU, SUnit *TargetSU, - std::set &Visited, bool &Reached) { + SmallPtrSet &Visited, bool &Reached) { if (Reached) return; if (SU == TargetSU) { Reached = true; return; } - if (!Visited.insert(SU).second) return; + if (!Visited.insert(SU)) return; for (SUnit::pred_iterator I = SU->Preds.begin(), E = SU->Preds.end(); I != E; ++I) @@ -694,7 +694,7 @@ static void isReachable(SUnit *SU, SUnit *TargetSU, } static bool isReachable(SUnit *SU, SUnit *TargetSU) { - std::set Visited; + SmallPtrSet Visited; bool Reached = false; isReachable(SU, TargetSU, Visited, Reached); return Reached; -- 2.34.1