File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -1029,9 +1029,9 @@ void SubtargetEmitter::expandProcResources(
1029
1029
for (unsigned I = 0 , E = PRVec.size (); I != E; ++I) {
1030
1030
const Record *PRDef = PRVec[I];
1031
1031
ConstRecVec SubResources;
1032
- if (PRDef->isSubClassOf (" ProcResGroup" ))
1032
+ if (PRDef->isSubClassOf (" ProcResGroup" )) {
1033
1033
SubResources = PRDef->getValueAsListOfDefs (" Resources" );
1034
- else {
1034
+ } else {
1035
1035
SubResources.push_back (PRDef);
1036
1036
PRDef = SchedModels.findProcResUnits (PRDef, PM, PRDef->getLoc ());
1037
1037
for (const Record *SubDef = PRDef;
@@ -1053,13 +1053,11 @@ void SubtargetEmitter::expandProcResources(
1053
1053
if (PR == PRDef || !PR->isSubClassOf (" ProcResGroup" ))
1054
1054
continue ;
1055
1055
ConstRecVec SuperResources = PR->getValueAsListOfDefs (" Resources" );
1056
- ConstRecIter SubI = SubResources.begin (), SubE = SubResources.end ();
1057
- for (; SubI != SubE; ++SubI) {
1058
- if (!is_contained (SuperResources, *SubI)) {
1059
- break ;
1060
- }
1061
- }
1062
- if (SubI == SubE) {
1056
+ bool AllContained =
1057
+ all_of (SubResources, [SuperResources](const Record *SubResource) {
1058
+ return is_contained (SuperResources, SubResource);
1059
+ });
1060
+ if (AllContained) {
1063
1061
PRVec.push_back (PR);
1064
1062
ReleaseAtCycles.push_back (ReleaseAtCycles[I]);
1065
1063
AcquireAtCycles.push_back (AcquireAtCycles[I]);
You can’t perform that action at this time.
0 commit comments