mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-27 14:34:58 +00:00
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
This commit is contained in:
parent
7971514755
commit
2ba528b3a7
@ -19,7 +19,6 @@
|
||||
#define LLVM_CODEGEN_MACHINEPASSREGISTRY_H
|
||||
|
||||
#include "llvm/CodeGen/Passes.h"
|
||||
#include "llvm/CodeGen/ScheduleDAG.h"
|
||||
#include "llvm/Support/CommandLine.h"
|
||||
|
||||
namespace llvm {
|
||||
|
@ -16,6 +16,7 @@
|
||||
#define LLVM_CODEGEN_SCHEDULEDAG_H
|
||||
|
||||
#include "llvm/CodeGen/SelectionDAG.h"
|
||||
#include "llvm/ADT/DenseMap.h"
|
||||
#include "llvm/ADT/SmallSet.h"
|
||||
|
||||
namespace llvm {
|
||||
@ -153,7 +154,7 @@ namespace llvm {
|
||||
public:
|
||||
virtual ~SchedulingPriorityQueue() {}
|
||||
|
||||
virtual void initNodes(std::map<SDNode*, SUnit*> &SUMap,
|
||||
virtual void initNodes(DenseMap<SDNode*, SUnit*> &SUMap,
|
||||
std::vector<SUnit> &SUnits) = 0;
|
||||
virtual void releaseState() = 0;
|
||||
|
||||
@ -180,7 +181,7 @@ namespace llvm {
|
||||
MachineConstantPool *ConstPool; // Target constant pool
|
||||
std::vector<SUnit*> Sequence; // The schedule. Null SUnit*'s
|
||||
// represent noop instructions.
|
||||
std::map<SDNode*, SUnit*> SUnitMap; // SDNode to SUnit mapping (n -> 1).
|
||||
DenseMap<SDNode*, SUnit*> SUnitMap; // SDNode to SUnit mapping (n -> 1).
|
||||
std::vector<SUnit> SUnits; // The scheduling units.
|
||||
SmallSet<SDNode*, 16> CommuteSet; // Nodes the should be commuted.
|
||||
|
||||
|
@ -328,7 +328,7 @@ public:
|
||||
LatencyPriorityQueue() : Queue(latency_sort(this)) {
|
||||
}
|
||||
|
||||
void initNodes(std::map<SDNode*, SUnit*> &sumap,
|
||||
void initNodes(DenseMap<SDNode*, SUnit*> &sumap,
|
||||
std::vector<SUnit> &sunits) {
|
||||
SUnits = &sunits;
|
||||
// Calculate node priorities.
|
||||
|
@ -430,7 +430,7 @@ namespace {
|
||||
RegReductionPriorityQueue() :
|
||||
Queue(SF(this)) {}
|
||||
|
||||
virtual void initNodes(std::map<SDNode*, SUnit*> &sumap,
|
||||
virtual void initNodes(DenseMap<SDNode*, SUnit*> &sumap,
|
||||
std::vector<SUnit> &sunits) {}
|
||||
virtual void releaseState() {}
|
||||
|
||||
@ -464,7 +464,7 @@ namespace {
|
||||
class VISIBILITY_HIDDEN BURegReductionPriorityQueue
|
||||
: public RegReductionPriorityQueue<SF> {
|
||||
// SUnitMap SDNode to SUnit mapping (n -> 1).
|
||||
std::map<SDNode*, SUnit*> *SUnitMap;
|
||||
DenseMap<SDNode*, SUnit*> *SUnitMap;
|
||||
|
||||
// SUnits - The SUnits for the current graph.
|
||||
const std::vector<SUnit> *SUnits;
|
||||
@ -477,7 +477,7 @@ namespace {
|
||||
BURegReductionPriorityQueue(const TargetInstrInfo *tii)
|
||||
: TII(tii) {}
|
||||
|
||||
void initNodes(std::map<SDNode*, SUnit*> &sumap,
|
||||
void initNodes(DenseMap<SDNode*, SUnit*> &sumap,
|
||||
std::vector<SUnit> &sunits) {
|
||||
SUnitMap = &sumap;
|
||||
SUnits = &sunits;
|
||||
@ -541,7 +541,7 @@ namespace {
|
||||
template<class SF>
|
||||
class TDRegReductionPriorityQueue : public RegReductionPriorityQueue<SF> {
|
||||
// SUnitMap SDNode to SUnit mapping (n -> 1).
|
||||
std::map<SDNode*, SUnit*> *SUnitMap;
|
||||
DenseMap<SDNode*, SUnit*> *SUnitMap;
|
||||
|
||||
// SUnits - The SUnits for the current graph.
|
||||
const std::vector<SUnit> *SUnits;
|
||||
@ -552,7 +552,7 @@ namespace {
|
||||
public:
|
||||
TDRegReductionPriorityQueue() {}
|
||||
|
||||
void initNodes(std::map<SDNode*, SUnit*> &sumap,
|
||||
void initNodes(DenseMap<SDNode*, SUnit*> &sumap,
|
||||
std::vector<SUnit> &sunits) {
|
||||
SUnitMap = &sumap;
|
||||
SUnits = &sunits;
|
||||
|
Loading…
x
Reference in New Issue
Block a user