X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FMC%2FMCSchedule.h;h=0c71ee513500ce2f101da62daf768fc3a2f26228;hb=ff233c9e5c3e439fd1eed84b9a9e88a5370572db;hp=62fb22fb2aaabd0c7c1ef7b03d15a069c1d3dd3b;hpb=12886db4a7af74f17281695320c40248cb263f55;p=oota-llvm.git diff --git a/include/llvm/MC/MCSchedule.h b/include/llvm/MC/MCSchedule.h index 62fb22fb2aa..0c71ee51350 100644 --- a/include/llvm/MC/MCSchedule.h +++ b/include/llvm/MC/MCSchedule.h @@ -27,11 +27,18 @@ struct MCProcResourceDesc { #ifndef NDEBUG const char *Name; #endif - unsigned Count; // Number of resource of this kind + unsigned NumUnits; // Number of resource of this kind unsigned SuperIdx; // Index of the resources kind that contains this kind. + // Buffered resources may be consumed at some indeterminate cycle after + // dispatch (e.g. for instructions that may issue out-of-order). Unbuffered + // resources always consume their resource some fixed number of cycles after + // dispatch (e.g. for instruction interlocking that may stall the pipeline). + bool IsBuffered; + bool operator==(const MCProcResourceDesc &Other) const { - return Count == Other.Count && SuperIdx == Other.SuperIdx; + return NumUnits == Other.NumUnits && SuperIdx == Other.SuperIdx + && IsBuffered == Other.IsBuffered; } }; @@ -47,10 +54,12 @@ struct MCWriteProcResEntry { }; /// Specify the latency in cpu cycles for a particular scheduling class and def -/// index. Also identify the WriteResources of this def. When the operand -/// expands to a sequence of writes, this ID is the last write in the sequence. +/// index. -1 indicates an invalid latency. Heuristics would typically consider +/// an instruction with invalid latency to have infinite latency. Also identify +/// the WriteResources of this def. When the operand expands to a sequence of +/// writes, this ID is the last write in the sequence. struct MCWriteLatencyEntry { - unsigned Cycles; + int Cycles; unsigned WriteResourceID; bool operator==(const MCWriteLatencyEntry &Other) const { @@ -208,7 +217,11 @@ public: unsigned getProcessorID() const { return ProcID; } /// Does this machine model include instruction-level scheduling. - bool hasInstrSchedModel() const { return SchedClassTable != NULL; } + bool hasInstrSchedModel() const { return SchedClassTable; } + + unsigned getNumProcResourceKinds() const { + return NumProcResourceKinds; + } const MCProcResourceDesc *getProcResource(unsigned ProcResourceIdx) const { assert(hasInstrSchedModel() && "No scheduling machine model");