[llvm] [NFC][AMDGPU] Rename some variable names to follow convention better (PR #213827)
Shilei Tian via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 4 06:26:10 PDT 2026
https://github.com/shiltian updated https://github.com/llvm/llvm-project/pull/213827
>From 2e884204c859654409e400593ce43f50a0a826b4 Mon Sep 17 00:00:00 2001
From: Shilei Tian <i at tianshilei.me>
Date: Tue, 4 Aug 2026 00:09:39 -0400
Subject: [PATCH] [NFC][AMDGPU] Rename some variable names to follow convention
better
This is a follow-up of #213491.
---
llvm/lib/Target/AMDGPU/AMDGPUReserveWWMRegs.cpp | 4 ++--
llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp | 9 ++++-----
llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h | 10 +++++-----
llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp | 10 +++++-----
4 files changed, 16 insertions(+), 17 deletions(-)
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