diff options
author | Craig Topper <craig.topper@sifive.com> | 2024-08-27 09:07:20 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-27 09:07:20 -0700 |
commit | f6b0c09214fd6805460689a36ed84489a8e89ef2 (patch) | |
tree | d6b2d5c214e7dd1ae66e3785e7182f512e207751 /llvm/lib/CodeGen/LiveDebugVariables.cpp | |
parent | d58bd21150914b4a2304c24b04a714bfb251c594 (diff) | |
download | llvm-f6b0c09214fd6805460689a36ed84489a8e89ef2.zip llvm-f6b0c09214fd6805460689a36ed84489a8e89ef2.tar.gz llvm-f6b0c09214fd6805460689a36ed84489a8e89ef2.tar.bz2 |
[LiveDebugVariables] Use VirtRegMap::hasPhys. NFC (#106186)
Use hasPhys instead of MCRegister::isPhysicalRegister.
I think the MCRegister returned from getPhys can only contain a physical
register or 0. hasPhys checks that the register returned from getPhys is non-zero.
So I think they are equivalent in this usage.
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugVariables.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveDebugVariables.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugVariables.cpp b/llvm/lib/CodeGen/LiveDebugVariables.cpp index d1341f1..48bcc0a 100644 --- a/llvm/lib/CodeGen/LiveDebugVariables.cpp +++ b/llvm/lib/CodeGen/LiveDebugVariables.cpp @@ -1529,8 +1529,7 @@ void UserValue::rewriteLocations(VirtRegMap &VRM, const MachineFunction &MF, // Only virtual registers are rewritten. if (Loc.isReg() && Loc.getReg() && Loc.getReg().isVirtual()) { Register VirtReg = Loc.getReg(); - if (VRM.isAssignedReg(VirtReg) && - Register::isPhysicalRegister(VRM.getPhys(VirtReg))) { + if (VRM.isAssignedReg(VirtReg) && VRM.hasPhys(VirtReg)) { // This can create a %noreg operand in rare cases when the sub-register // index is no longer available. That means the user value is in a // non-existent sub-register, and %noreg is exactly what we want. @@ -1839,8 +1838,7 @@ void LDVImpl::emitDebugValues(VirtRegMap *VRM) { unsigned SubReg = It.second.SubReg; MachineBasicBlock *OrigMBB = Slots->getMBBFromIndex(Slot); - if (VRM->isAssignedReg(Reg) && - Register::isPhysicalRegister(VRM->getPhys(Reg))) { + if (VRM->isAssignedReg(Reg) && VRM->hasPhys(Reg)) { unsigned PhysReg = VRM->getPhys(Reg); if (SubReg != 0) PhysReg = TRI->getSubReg(PhysReg, SubReg); |