[llvm] 3217105 - [NFC][AMDGPU] Rename some variable names to follow convention better (#213827)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 4 07:27:12 PDT 2026
Author: Shilei Tian
Date: 2026-08-04T10:27:08-04:00
New Revision: 3217105056c59500981c1d00b60ac4d474b37b03
URL: https://github.com/llvm/llvm-project/commit/3217105056c59500981c1d00b60ac4d474b37b03
DIFF: https://github.com/llvm/llvm-project/commit/3217105056c59500981c1d00b60ac4d474b37b03.diff
LOG: [NFC][AMDGPU] Rename some variable names to follow convention better (#213827)
This is a follow-up of #213491.
Added:
Modified:
llvm/lib/Target/AMDGPU/AMDGPUReserveWWMRegs.cpp
llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp
llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h
llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUReserveWWMRegs.cpp b/llvm/lib/Target/AMDGPU/AMDGPUReserveWWMRegs.cpp
index 94830ba998f27..577362d5a8caf 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUReserveWWMRegs.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUReserveWWMRegs.cpp
@@ -104,8 +104,8 @@ bool AMDGPUReserveWWMRegs::run(MachineFunction &MF) {
MO.setIsRenamable(false);
}
- // Now clear the NonWWMRegMask earlier set during wwm-regalloc.
- MFI->clearNonWWMRegAllocMask();
+ // Now clear the PerLaneVGPRMask earlier set during wwm-regalloc.
+ MFI->clearPerLaneVGPRAllocMask();
return Changed;
}
diff --git a/llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp b/llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp
index 5bf34ddcb2816..2fa7feb9d3327 100644
--- a/llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp
+++ b/llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp
@@ -427,12 +427,11 @@ void SILowerSGPRSpills::assignWWMRegs(MachineFunction &MF,
"cannot find enough VGPRs for wwm-regalloc");
}
- BitVector NonWwmRegMask(WwmRegMask);
- NonWwmRegMask.flip().clearBitsNotInMask(TRI->getAllVGPRRegMask());
+ BitVector PerLaneVGPRMask(WwmRegMask);
+ PerLaneVGPRMask.flip().clearBitsNotInMask(TRI->getAllVGPRRegMask());
- // The complement set will be the registers for non-wwm (per-thread) vgpr
- // allocation.
- FuncInfo->updateNonWWMRegMask(NonWwmRegMask);
+ // The complement set will be the registers for per-lane VGPR allocation.
+ FuncInfo->updatePerLaneVGPRMask(PerLaneVGPRMask);
}
bool SILowerSGPRSpillsLegacy::runOnMachineFunction(MachineFunction &MF) {
diff --git a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h
index 2d1b77fc4fb8f..0207c728ea9b8 100644
--- a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h
+++ b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h
@@ -580,9 +580,9 @@ class SIMachineFunctionInfo final : public AMDGPUMachineFunctionInfo,
WWMSpillsMap WWMSpills;
// Before allocation, the VGPR registers are partitioned into two distinct
- // sets, the first one for WWM-values and the second set for non-WWM values.
+ // sets, the first one for WWM values and the second set for per-lane values.
// The latter set should be reserved during WWM-regalloc.
- BitVector NonWWMRegMask;
+ BitVector PerLaneVGPRMask;
using ReservedRegSet = SmallSetVector<Register, 8>;
// To track the VGPRs reserved for WWM instructions. They get stack slots
@@ -679,9 +679,9 @@ class SIMachineFunctionInfo final : public AMDGPUMachineFunctionInfo,
: WWMReservedRegs.contains(Reg);
}
- void updateNonWWMRegMask(BitVector &RegMask) { NonWWMRegMask = RegMask; }
- BitVector getNonWWMRegMask() const { return NonWWMRegMask; }
- void clearNonWWMRegAllocMask() { NonWWMRegMask.clear(); }
+ void updatePerLaneVGPRMask(BitVector &RegMask) { PerLaneVGPRMask = RegMask; }
+ BitVector getPerLaneVGPRMask() const { return PerLaneVGPRMask; }
+ void clearPerLaneVGPRAllocMask() { PerLaneVGPRMask.clear(); }
SIModeRegisterDefaults getMode() const { return Mode; }
diff --git a/llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp b/llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
index 01220a701a453..a3d6509628d50 100644
--- a/llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
@@ -752,14 +752,14 @@ BitVector SIRegisterInfo::getReservedRegs(const MachineFunction &MF) const {
reserveRegisterTuples(Reserved, MFI->getVGPRForAGPRCopy());
}
- // During wwm-regalloc, reserve the registers for perlane VGPR allocation. The
- // MFI->getNonWWMRegMask() field will have a valid bitmask only during
+ // During wwm-regalloc, reserve the registers for per-lane VGPR allocation.
+ // The MFI->getPerLaneVGPRMask() field will have a valid bitmask only during
// wwm-regalloc and it would be empty otherwise.
- BitVector NonWWMRegMask = MFI->getNonWWMRegMask();
- if (!NonWWMRegMask.empty()) {
+ BitVector PerLaneVGPRMask = MFI->getPerLaneVGPRMask();
+ if (!PerLaneVGPRMask.empty()) {
for (unsigned RegI = AMDGPU::VGPR0, RegE = AMDGPU::VGPR0 + MaxNumVGPRs;
RegI < RegE; ++RegI) {
- if (NonWWMRegMask.test(RegI))
+ if (PerLaneVGPRMask.test(RegI))
reserveRegisterTuples(Reserved, RegI);
}
}
More information about the llvm-commits
mailing list