[llvm] 0a44d3a - [CodeGen] Use MCRegister instead of MCPhysReg in VirtRegMap. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 18 23:10:16 PST 2025
Author: Craig Topper
Date: 2025-01-18T23:03:03-08:00
New Revision: 0a44d3a57f03e8263f1509eb397201c9e07b21aa
URL: https://github.com/llvm/llvm-project/commit/0a44d3a57f03e8263f1509eb397201c9e07b21aa
DIFF: https://github.com/llvm/llvm-project/commit/0a44d3a57f03e8263f1509eb397201c9e07b21aa.diff
LOG: [CodeGen] Use MCRegister instead of MCPhysReg in VirtRegMap. NFC
The callers of these methods already use MCRegister.
Added:
Modified:
llvm/include/llvm/CodeGen/VirtRegMap.h
llvm/lib/CodeGen/VirtRegMap.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/CodeGen/VirtRegMap.h b/llvm/include/llvm/CodeGen/VirtRegMap.h
index 45750f34fa2009..c9e405e1981d98 100644
--- a/llvm/include/llvm/CodeGen/VirtRegMap.h
+++ b/llvm/include/llvm/CodeGen/VirtRegMap.h
@@ -94,7 +94,7 @@ class VirtRegMap {
/// creates a mapping for the specified virtual register to
/// the specified physical register
- void assignVirt2Phys(Register virtReg, MCPhysReg physReg);
+ void assignVirt2Phys(Register virtReg, MCRegister physReg);
bool isShapeMapEmpty() const { return Virt2ShapeMap.empty(); }
diff --git a/llvm/lib/CodeGen/VirtRegMap.cpp b/llvm/lib/CodeGen/VirtRegMap.cpp
index d6c020172b96b5..b3a7acc15b3dc4 100644
--- a/llvm/lib/CodeGen/VirtRegMap.cpp
+++ b/llvm/lib/CodeGen/VirtRegMap.cpp
@@ -83,8 +83,8 @@ void VirtRegMap::grow() {
Virt2SplitMap.resize(NumRegs);
}
-void VirtRegMap::assignVirt2Phys(Register virtReg, MCPhysReg physReg) {
- assert(virtReg.isVirtual() && Register::isPhysicalRegister(physReg));
+void VirtRegMap::assignVirt2Phys(Register virtReg, MCRegister physReg) {
+ assert(virtReg.isVirtual() && physReg.isPhysical());
assert(!Virt2PhysMap[virtReg] &&
"attempt to assign physical register to already mapped "
"virtual register");
@@ -221,7 +221,7 @@ class VirtRegRewriter : public MachineFunctionPass {
bool subRegLiveThrough(const MachineInstr &MI, MCRegister SuperPhysReg) const;
LaneBitmask liveOutUndefPhiLanesForUndefSubregDef(
const LiveInterval &LI, const MachineBasicBlock &MBB, unsigned SubReg,
- MCPhysReg PhysReg, const MachineInstr &MI) const;
+ MCRegister PhysReg, const MachineInstr &MI) const;
public:
static char ID;
@@ -563,7 +563,7 @@ bool VirtRegRewriter::subRegLiveThrough(const MachineInstr &MI,
/// is assigned to \p LI, which is the main range.
LaneBitmask VirtRegRewriter::liveOutUndefPhiLanesForUndefSubregDef(
const LiveInterval &LI, const MachineBasicBlock &MBB, unsigned SubReg,
- MCPhysReg PhysReg, const MachineInstr &MI) const {
+ MCRegister PhysReg, const MachineInstr &MI) const {
LaneBitmask UndefMask = ~TRI->getSubRegIndexLaneMask(SubReg);
LaneBitmask LiveOutUndefLanes;
More information about the llvm-commits
mailing list