diff options
| author | Craig Topper <craig.topper@sifive.com> | 2023-01-13 14:38:08 -0800 |
|---|---|---|
| committer | Craig Topper <craig.topper@sifive.com> | 2023-01-13 14:38:08 -0800 |
| commit | e72ca520bb4806d4003ef69698089fd83a5777cb (patch) | |
| tree | d0ae50a1b48efe90bce1b4398ceb3cad1e33f7b3 /llvm/lib/CodeGen/LiveIntervals.cpp | |
| parent | 2ca4b4f82e993d31c67a0e595ca584f860cd6811 (diff) | |
[CodeGen] Remove uses of Register::isPhysicalRegister/isVirtualRegister. NFC
Use isPhysical/isVirtual methods.
Reviewed By: foad
Differential Revision: https://reviews.llvm.org/D141715
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervals.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/LiveIntervals.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervals.cpp b/llvm/lib/CodeGen/LiveIntervals.cpp index 47173d353241..a49f6b0604c5 100644 --- a/llvm/lib/CodeGen/LiveIntervals.cpp +++ b/llvm/lib/CodeGen/LiveIntervals.cpp @@ -180,7 +180,7 @@ LLVM_DUMP_METHOD void LiveIntervals::dumpInstrs() const { #endif LiveInterval *LiveIntervals::createInterval(Register reg) { - float Weight = Register::isPhysicalRegister(reg) ? huge_valf : 0.0F; + float Weight = reg.isPhysical() ? huge_valf : 0.0F; return new LiveInterval(reg, Weight); } @@ -449,8 +449,7 @@ void LiveIntervals::extendSegmentsToUses(LiveRange &Segments, bool LiveIntervals::shrinkToUses(LiveInterval *li, SmallVectorImpl<MachineInstr*> *dead) { LLVM_DEBUG(dbgs() << "Shrink: " << *li << '\n'); - assert(Register::isVirtualRegister(li->reg()) && - "Can only shrink virtual registers"); + assert(li->reg().isVirtual() && "Can only shrink virtual registers"); // Shrink subregister live ranges. bool NeedsCleanup = false; @@ -551,8 +550,7 @@ bool LiveIntervals::computeDeadValues(LiveInterval &LI, void LiveIntervals::shrinkToUses(LiveInterval::SubRange &SR, Register Reg) { LLVM_DEBUG(dbgs() << "Shrink: " << SR << '\n'); - assert(Register::isVirtualRegister(Reg) && - "Can only shrink virtual registers"); + assert(Reg.isVirtual() && "Can only shrink virtual registers"); // Find all the values used, including PHI kills. ShrinkToUsesWorkList WorkList; @@ -1021,7 +1019,7 @@ public: Register Reg = MO.getReg(); if (!Reg) continue; - if (Register::isVirtualRegister(Reg)) { + if (Reg.isVirtual()) { LiveInterval &LI = LIS.getInterval(Reg); if (LI.hasSubRanges()) { unsigned SubReg = MO.getSubReg(); @@ -1075,7 +1073,7 @@ private: return; LLVM_DEBUG({ dbgs() << " "; - if (Register::isVirtualRegister(Reg)) { + if (Reg.isVirtual()) { dbgs() << printReg(Reg); if (LaneMask.any()) dbgs() << " L" << PrintLaneMask(LaneMask); @@ -1451,7 +1449,7 @@ private: // Return the last use of reg between NewIdx and OldIdx. SlotIndex findLastUseBefore(SlotIndex Before, Register Reg, LaneBitmask LaneMask) { - if (Register::isVirtualRegister(Reg)) { + if (Reg.isVirtual()) { SlotIndex LastUse = Before; for (MachineOperand &MO : MRI.use_nodbg_operands(Reg)) { if (MO.isUndef()) @@ -1495,8 +1493,7 @@ private: // Check if MII uses Reg. for (MIBundleOperands MO(*MII); MO.isValid(); ++MO) - if (MO->isReg() && !MO->isUndef() && - Register::isPhysicalRegister(MO->getReg()) && + if (MO->isReg() && !MO->isUndef() && MO->getReg().isPhysical() && TRI.hasRegUnit(MO->getReg(), Reg)) return Idx.getRegSlot(); } |
