Skip to content

Commit 6d4e75c

Browse files
authored
[MISched][NFC] Rename isUnbufferedGroup to isReservedGroup (llvm#166439)
In both ScheduleDAGInstrs and MachineScheduler, we call `BufferSize = 0` as _reserved_ and `BufferSize = 1` as _unbuffered_. This convention is stem from the fact that we set `SUnit::hasReservedResource` to true when any of the SUnit's consumed resources has BufferSize equal to zero; set `SUnit::isUnbuffered` to true when any of its consumed resources has BufferSize equal to one. However, `SchedBoundary::isUnbufferedGroup` doesn't really follow this convention: it returns true when the resource in question is a `ProcResGroup` and its BufferSize equals to **zero** rather than one. This could be really confusing for the reader. This patch renames this function to `isReservedGroup` in aligned with the convention mentioned above. NFC.
1 parent d8e5698 commit 6d4e75c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

llvm/include/llvm/CodeGen/MachineScheduler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ class SchedBoundary {
10381038
getNextResourceCycle(const MCSchedClassDesc *SC, unsigned PIdx,
10391039
unsigned ReleaseAtCycle, unsigned AcquireAtCycle);
10401040

1041-
bool isUnbufferedGroup(unsigned PIdx) const {
1041+
bool isReservedGroup(unsigned PIdx) const {
10421042
return SchedModel->getProcResource(PIdx)->SubUnitsIdxBegin &&
10431043
!SchedModel->getProcResource(PIdx)->BufferSize;
10441044
}

llvm/lib/CodeGen/MachineScheduler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2559,7 +2559,7 @@ init(ScheduleDAGMI *dag, const TargetSchedModel *smodel, SchedRemainder *rem) {
25592559
for (unsigned i = 0; i < ResourceCount; ++i) {
25602560
ReservedCyclesIndex[i] = NumUnits;
25612561
NumUnits += SchedModel->getProcResource(i)->NumUnits;
2562-
if (isUnbufferedGroup(i)) {
2562+
if (isReservedGroup(i)) {
25632563
auto SubUnits = SchedModel->getProcResource(i)->SubUnitsIdxBegin;
25642564
for (unsigned U = 0, UE = SchedModel->getProcResource(i)->NumUnits;
25652565
U != UE; ++U)
@@ -2631,7 +2631,7 @@ SchedBoundary::getNextResourceCycle(const MCSchedClassDesc *SC, unsigned PIdx,
26312631
assert(NumberOfInstances > 0 &&
26322632
"Cannot have zero instances of a ProcResource");
26332633

2634-
if (isUnbufferedGroup(PIdx)) {
2634+
if (isReservedGroup(PIdx)) {
26352635
// If any subunits are used by the instruction, report that the
26362636
// subunits of the resource group are available at the first cycle
26372637
// in which the unit is available, effectively removing the group

0 commit comments

Comments
 (0)