forked from OSchip/llvm-project
[SchedModel] Use CodeGenSchedClass::isKeyEqual instead of duplicating code. NFCI.
llvm-svn: 328126
This commit is contained in:
parent
430aa7405f
commit
4cca3b190b
|
@ -652,12 +652,9 @@ void CodeGenSchedModels::collectSchedClasses() {
|
|||
unsigned CodeGenSchedModels::findSchedClassIdx(Record *ItinClassDef,
|
||||
ArrayRef<unsigned> Writes,
|
||||
ArrayRef<unsigned> Reads) const {
|
||||
for (SchedClassIter I = schedClassBegin(), E = schedClassEnd(); I != E; ++I) {
|
||||
if (I->ItinClassDef == ItinClassDef && makeArrayRef(I->Writes) == Writes &&
|
||||
makeArrayRef(I->Reads) == Reads) {
|
||||
for (SchedClassIter I = schedClassBegin(), E = schedClassEnd(); I != E; ++I)
|
||||
if (I->isKeyEqual(ItinClassDef, Writes, Reads))
|
||||
return I - schedClassBegin();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -141,7 +141,8 @@ struct CodeGenSchedClass {
|
|||
|
||||
CodeGenSchedClass(): Index(0), ItinClassDef(nullptr) {}
|
||||
|
||||
bool isKeyEqual(Record *IC, ArrayRef<unsigned> W, ArrayRef<unsigned> R) {
|
||||
bool isKeyEqual(Record *IC, ArrayRef<unsigned> W,
|
||||
ArrayRef<unsigned> R) const {
|
||||
return ItinClassDef == IC && makeArrayRef(Writes) == W &&
|
||||
makeArrayRef(Reads) == R;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue