llvm.org GIT mirror llvm / 2ba528b
switch the sched unit map over to use a DenseMap instead of std::map. This speeds up isel as a whole time by 2.6%. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33810 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 13 years ago
4 changed file(s) with 9 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
1818 #define LLVM_CODEGEN_MACHINEPASSREGISTRY_H
1919
2020 #include "llvm/CodeGen/Passes.h"
21 #include "llvm/CodeGen/ScheduleDAG.h"
2221 #include "llvm/Support/CommandLine.h"
2322
2423 namespace llvm {
1515 #define LLVM_CODEGEN_SCHEDULEDAG_H
1616
1717 #include "llvm/CodeGen/SelectionDAG.h"
18 #include "llvm/ADT/DenseMap.h"
1819 #include "llvm/ADT/SmallSet.h"
1920
2021 namespace llvm {
152153 public:
153154 virtual ~SchedulingPriorityQueue() {}
154155
155 virtual void initNodes(std::map &SUMap,
156 virtual void initNodes(DenseMap &SUMap,
156157 std::vector &SUnits) = 0;
157158 virtual void releaseState() = 0;
158159
179180 MachineConstantPool *ConstPool; // Target constant pool
180181 std::vector Sequence; // The schedule. Null SUnit*'s
181182 // represent noop instructions.
182 std::map SUnitMap; // SDNode to SUnit mapping (n -> 1).
183 DenseMap SUnitMap; // SDNode to SUnit mapping (n -> 1).
183184 std::vector SUnits; // The scheduling units.
184185 SmallSet CommuteSet; // Nodes the should be commuted.
185186
327327 LatencyPriorityQueue() : Queue(latency_sort(this)) {
328328 }
329329
330 void initNodes(std::map &sumap,
330 void initNodes(DenseMap &sumap,
331331 std::vector &sunits) {
332332 SUnits = &sunits;
333333 // Calculate node priorities.
429429 RegReductionPriorityQueue() :
430430 Queue(SF(this)) {}
431431
432 virtual void initNodes(std::map &sumap,
432 virtual void initNodes(DenseMap &sumap,
433433 std::vector &sunits) {}
434434 virtual void releaseState() {}
435435
463463 class VISIBILITY_HIDDEN BURegReductionPriorityQueue
464464 : public RegReductionPriorityQueue {
465465 // SUnitMap SDNode to SUnit mapping (n -> 1).
466 std::map *SUnitMap;
466 DenseMap *SUnitMap;
467467
468468 // SUnits - The SUnits for the current graph.
469469 const std::vector *SUnits;
476476 BURegReductionPriorityQueue(const TargetInstrInfo *tii)
477477 : TII(tii) {}
478478
479 void initNodes(std::map &sumap,
479 void initNodes(DenseMap &sumap,
480480 std::vector &sunits) {
481481 SUnitMap = &sumap;
482482 SUnits = &sunits;
540540 template
541541 class TDRegReductionPriorityQueue : public RegReductionPriorityQueue {
542542 // SUnitMap SDNode to SUnit mapping (n -> 1).
543 std::map *SUnitMap;
543 DenseMap *SUnitMap;
544544
545545 // SUnits - The SUnits for the current graph.
546546 const std::vector *SUnits;
551551 public:
552552 TDRegReductionPriorityQueue() {}
553553
554 void initNodes(std::map &sumap,
554 void initNodes(DenseMap &sumap,
555555 std::vector &sunits) {
556556 SUnitMap = &sumap;
557557 SUnits = &sunits;