diff options
Diffstat (limited to 'contrib/llvm/utils/TableGen/CodeGenSchedule.h')
-rw-r--r-- | contrib/llvm/utils/TableGen/CodeGenSchedule.h | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/contrib/llvm/utils/TableGen/CodeGenSchedule.h b/contrib/llvm/utils/TableGen/CodeGenSchedule.h index e5241b9d5fda..f5c50c992a92 100644 --- a/contrib/llvm/utils/TableGen/CodeGenSchedule.h +++ b/contrib/llvm/utils/TableGen/CodeGenSchedule.h @@ -72,10 +72,10 @@ struct CodeGenSchedRW { IsSequence = Def->isSubClassOf("WriteSequence"); } - CodeGenSchedRW(unsigned Idx, bool Read, const IdxVec &Seq, + CodeGenSchedRW(unsigned Idx, bool Read, ArrayRef<unsigned> Seq, const std::string &Name) - : Index(Idx), Name(Name), TheDef(nullptr), IsRead(Read), IsAlias(false), - HasVariants(false), IsVariadic(false), IsSequence(true), Sequence(Seq) { + : Index(Idx), Name(Name), TheDef(nullptr), IsRead(Read), IsAlias(false), + HasVariants(false), IsVariadic(false), IsSequence(true), Sequence(Seq) { assert(Sequence.size() > 1 && "implied sequence needs >1 RWs"); } @@ -144,8 +144,9 @@ struct CodeGenSchedClass { CodeGenSchedClass(): Index(0), ItinClassDef(nullptr) {} - bool isKeyEqual(Record *IC, const IdxVec &W, const IdxVec &R) { - return ItinClassDef == IC && Writes == W && Reads == R; + bool isKeyEqual(Record *IC, ArrayRef<unsigned> W, ArrayRef<unsigned> R) { + return ItinClassDef == IC && makeArrayRef(Writes) == W && + makeArrayRef(Reads) == R; } // Is this class generated from a variants if existing classes? Instructions @@ -256,18 +257,16 @@ public: class_iterator classes_end() { return SchedClasses.end(); } const_class_iterator classes_end() const { return SchedClasses.end(); } iterator_range<class_iterator> classes() { - return iterator_range<class_iterator>(classes_begin(), classes_end()); + return make_range(classes_begin(), classes_end()); } iterator_range<const_class_iterator> classes() const { - return iterator_range<const_class_iterator>(classes_begin(), classes_end()); + return make_range(classes_begin(), classes_end()); } iterator_range<class_iterator> explicit_classes() { - return iterator_range<class_iterator>( - classes_begin(), classes_begin() + NumInstrSchedClasses); + return make_range(classes_begin(), classes_begin() + NumInstrSchedClasses); } iterator_range<const_class_iterator> explicit_classes() const { - return iterator_range<const_class_iterator>( - classes_begin(), classes_begin() + NumInstrSchedClasses); + return make_range(classes_begin(), classes_begin() + NumInstrSchedClasses); } Record *getModelOrItinDef(Record *ProcDef) const { @@ -363,14 +362,14 @@ public: void expandRWSeqForProc(unsigned RWIdx, IdxVec &RWSeq, bool IsRead, const CodeGenProcModel &ProcModel) const; - unsigned addSchedClass(Record *ItinDef, const IdxVec &OperWrites, - const IdxVec &OperReads, const IdxVec &ProcIndices); + unsigned addSchedClass(Record *ItinDef, ArrayRef<unsigned> OperWrites, + ArrayRef<unsigned> OperReads, + ArrayRef<unsigned> ProcIndices); unsigned findOrInsertRW(ArrayRef<unsigned> Seq, bool IsRead); - unsigned findSchedClassIdx(Record *ItinClassDef, - const IdxVec &Writes, - const IdxVec &Reads) const; + unsigned findSchedClassIdx(Record *ItinClassDef, ArrayRef<unsigned> Writes, + ArrayRef<unsigned> Reads) const; Record *findProcResUnits(Record *ProcResKind, const CodeGenProcModel &PM) const; @@ -383,14 +382,14 @@ private: void collectSchedRW(); - std::string genRWName(const IdxVec& Seq, bool IsRead); - unsigned findRWForSequence(const IdxVec &Seq, bool IsRead); + std::string genRWName(ArrayRef<unsigned> Seq, bool IsRead); + unsigned findRWForSequence(ArrayRef<unsigned> Seq, bool IsRead); void collectSchedClasses(); std::string createSchedClassName(Record *ItinClassDef, - const IdxVec &OperWrites, - const IdxVec &OperReads); + ArrayRef<unsigned> OperWrites, + ArrayRef<unsigned> OperReads); std::string createSchedClassName(const RecVec &InstDefs); void createInstRWClass(Record *InstRWDef); @@ -400,8 +399,8 @@ private: void inferSchedClasses(); - void inferFromRW(const IdxVec &OperWrites, const IdxVec &OperReads, - unsigned FromClassIdx, const IdxVec &ProcIndices); + void inferFromRW(ArrayRef<unsigned> OperWrites, ArrayRef<unsigned> OperReads, + unsigned FromClassIdx, ArrayRef<unsigned> ProcIndices); void inferFromItinClass(Record *ItinClassDef, unsigned FromClassIdx); void inferFromInstRWs(unsigned SCIdx); @@ -413,10 +412,10 @@ private: void collectItinProcResources(Record *ItinClassDef); void collectRWResources(unsigned RWIdx, bool IsRead, - const IdxVec &ProcIndices); + ArrayRef<unsigned> ProcIndices); - void collectRWResources(const IdxVec &Writes, const IdxVec &Reads, - const IdxVec &ProcIndices); + void collectRWResources(ArrayRef<unsigned> Writes, ArrayRef<unsigned> Reads, + ArrayRef<unsigned> ProcIndices); void addProcResource(Record *ProcResourceKind, CodeGenProcModel &PM); |