namespace llvm {
-typedef long long cycles_t;
-static const cycles_t HUGE_LATENCY = ~((long long) 1 << (sizeof(cycles_t)-2));
-static const cycles_t INVALID_LATENCY = -HUGE_LATENCY;
-static const unsigned MAX_OPCODE_SIZE = 16;
-
-class OpCodePair {
-public:
- long val; // make long by concatenating two opcodes
- OpCodePair(MachineOpCode op1, MachineOpCode op2)
- : val((op1 < 0 || op2 < 0)?
- -1 : (long)((((unsigned) op1) << MAX_OPCODE_SIZE) | (unsigned) op2)) {}
- bool operator==(const OpCodePair& op) const {
- return val == op.val;
- }
-private:
- OpCodePair(); // disable for now
-};
-
-} // End llvm namespace
-
-namespace HASH_NAMESPACE {
- template <> struct hash<llvm::OpCodePair> {
- size_t operator()(const llvm::OpCodePair& pair) const {
- return hash<long>()(pair.val);
- }
- };
-} // End HASH_NAMESPACE (a macro) namespace
-
-namespace llvm {
+typedef long long CycleCount_t;
+static const CycleCount_t HUGE_LATENCY = ~((long long) 1 << (sizeof(CycleCount_t)-2));
+static const CycleCount_t INVALID_LATENCY = -HUGE_LATENCY;
//---------------------------------------------------------------------------
// class MachineResource
unsigned maxNumIssue;
bool isSingleIssue;
bool breaksGroup;
- cycles_t numBubbles;
+ CycleCount_t numBubbles;
// Feasible slots to use for instructions in this class.
// The size of vector S[] is `numSlots'.
MachineOpCode opCode;
bool isSingleIssue;
bool breaksGroup;
- cycles_t numBubbles;
+ CycleCount_t numBubbles;
};
// Issue restrictions for this instruction
bool isSingleIssue;
bool breaksGroup;
- cycles_t numBubbles;
+ CycleCount_t numBubbles;
// Feasible slots to use for this instruction.
std::vector<bool> feasibleSlots;
// Resource usages for this instruction, with one resource vector per cycle.
- cycles_t numCycles;
+ CycleCount_t numCycles;
std::vector<std::vector<resourceId_t> > resourcesByCycle;
private:
/// TargetSchedInfo - Common interface to machine information for
/// instruction scheduling
///
-struct TargetSchedInfo {
+class TargetSchedInfo {
+public:
const TargetMachine& target;
unsigned maxNumIssueTotal;