summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/CodeGenSchedule.h
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2012-09-15 00:20:02 +0000
committerAndrew Trick <atrick@apple.com>2012-09-15 00:20:02 +0000
commit1e46d48814c475503cf8469076949c0523ba1613 (patch)
tree59f3d1b45123502010a804e9540ff4401a1857d5 /llvm/utils/TableGen/CodeGenSchedule.h
parent33401e8469e94ffae4786199ff435269090b6f6c (diff)
downloadbcm5719-llvm-1e46d48814c475503cf8469076949c0523ba1613.tar.gz
bcm5719-llvm-1e46d48814c475503cf8469076949c0523ba1613.zip
TableGen subtarget parser. Handle new machine model.
Collect processor resources from the subtarget defs. llvm-svn: 163953
Diffstat (limited to 'llvm/utils/TableGen/CodeGenSchedule.h')
-rw-r--r--llvm/utils/TableGen/CodeGenSchedule.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/llvm/utils/TableGen/CodeGenSchedule.h b/llvm/utils/TableGen/CodeGenSchedule.h
index e9c8359410c..992ae82d4c0 100644
--- a/llvm/utils/TableGen/CodeGenSchedule.h
+++ b/llvm/utils/TableGen/CodeGenSchedule.h
@@ -171,10 +171,23 @@ struct CodeGenProcModel {
// This list is empty if no ItinRW refers to this Processor.
RecVec ItinRWDefs;
+ // All read/write resources associated with this processor.
+ RecVec WriteResDefs;
+ RecVec ReadAdvanceDefs;
+
+ // Per-operand machine model resources associated with this processor.
+ RecVec ProcResourceDefs;
+
CodeGenProcModel(unsigned Idx, const std::string &Name, Record *MDef,
Record *IDef) :
Index(Idx), ModelName(Name), ModelDef(MDef), ItinsDef(IDef) {}
+ bool hasInstrSchedModel() const {
+ return !WriteResDefs.empty() || !ItinRWDefs.empty();
+ }
+
+ unsigned getProcResourceIdx(Record *PRDef) const;
+
#ifndef NDEBUG
void dump() const;
#endif
@@ -326,6 +339,9 @@ public:
unsigned findSchedClassIdx(const IdxVec &Writes, const IdxVec &Reads) const;
+ Record *findProcResUnits(Record *ProcResKind,
+ const CodeGenProcModel &PM) const;
+
private:
void collectProcModels();
@@ -354,6 +370,19 @@ private:
unsigned FromClassIdx, const IdxVec &ProcIndices);
void inferFromItinClass(Record *ItinClassDef, unsigned FromClassIdx);
void inferFromInstRWs(unsigned SCIdx);
+
+ void collectProcResources();
+
+ void collectItinProcResources(Record *ItinClassDef);
+
+ void collectRWResources(const IdxVec &Writes, const IdxVec &Reads,
+ const IdxVec &ProcIndices);
+
+ void addProcResource(Record *ProcResourceKind, CodeGenProcModel &PM);
+
+ void addWriteRes(Record *ProcWriteResDef, unsigned PIdx);
+
+ void addReadAdvance(Record *ProcReadAdvanceDef, unsigned PIdx);
};
} // namespace llvm
OpenPOWER on IntegriCloud