diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2007-06-22 01:35:51 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2007-06-22 01:35:51 +0000 |
| commit | e3c4419953797b1cefe2b56a4f04654d3f4cd567 (patch) | |
| tree | 24591d2d3e09a88970f2b5ebe38c047247512845 /llvm/lib/CodeGen | |
| parent | 485531ea9bb248506f657f9f7b753518b5de5903 (diff) | |
| download | bcm5719-llvm-e3c4419953797b1cefe2b56a4f04654d3f4cd567.tar.gz bcm5719-llvm-e3c4419953797b1cefe2b56a4f04654d3f4cd567.zip | |
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.
llvm-svn: 37701
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp index 08292bb6e4d..dcdb9615cc6 100644 --- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp +++ b/llvm/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<SUnit *> OperandSeen; + SmallPtrSet<SUnit*, 4> 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<SUnit *> &Visited, bool &Reached) { + SmallPtrSet<SUnit*, 32> &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<SUnit *> Visited; + SmallPtrSet<SUnit*, 32> Visited; bool Reached = false; isReachable(SU, TargetSU, Visited, Reached); return Reached; |

