aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-06-22 01:35:51 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-06-22 01:35:51 +0000
commit0b2ce1fc19c5f8742051cf022ac119a3d4d9a3ad (patch)
tree6db21ec2584bca1ee5f200ab32f933a9dc3fbda1
parent5411835165429dc409012adc5efaf92c4938563f (diff)
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
-rw-r--r--lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
index 08292bb6e4..dcdb9615cc 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<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;