Skip to content

[TableGen] Make more use of CodeGenRegisterClass::EnumValue. NFC. #132749

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions llvm/utils/TableGen/Common/CodeGenRegisters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2103,9 +2103,7 @@ void CodeGenRegBank::computeRegUnitSets() {

// For each register class, list the UnitSets that are supersets.
RegClassUnitSets.resize(RegClasses.size());
int RCIdx = -1;
for (auto &RC : RegClasses) {
++RCIdx;
if (!RC.Allocatable)
continue;

Expand All @@ -2127,12 +2125,13 @@ void CodeGenRegBank::computeRegUnitSets() {
++USIdx) {
if (isRegUnitSubSet(RCRegUnits, RegUnitSets[USIdx].Units)) {
LLVM_DEBUG(dbgs() << " " << USIdx);
RegClassUnitSets[RCIdx].push_back(USIdx);
RegClassUnitSets[RC.EnumValue].push_back(USIdx);
}
}
LLVM_DEBUG(dbgs() << "\n");
assert((!RegClassUnitSets[RCIdx].empty() || !RC.GeneratePressureSet) &&
"missing unit set for regclass");
assert(
(!RegClassUnitSets[RC.EnumValue].empty() || !RC.GeneratePressureSet) &&
"missing unit set for regclass");
}

// For each register unit, ensure that we have the list of UnitSets that
Expand Down