Skip to content

Commit d0b8f5d

Browse files
committed
[RegisterBankInfo] Use MCRegister instead of Register for getMinimalPhysRegClass. NFC
1 parent 68b1fe8 commit d0b8f5d

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

llvm/include/llvm/CodeGen/RegisterBankInfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ class RegisterBankInfo {
419419

420420
/// Getting the minimal register class of a physreg is expensive.
421421
/// Cache this information as we get it.
422-
mutable DenseMap<unsigned, const TargetRegisterClass *> PhysRegMinimalRCs;
422+
mutable DenseMap<MCRegister, const TargetRegisterClass *> PhysRegMinimalRCs;
423423

424424
/// Create a RegisterBankInfo that can accommodate up to \p NumRegBanks
425425
/// RegisterBank instances.
@@ -445,7 +445,7 @@ class RegisterBankInfo {
445445
/// Get the MinimalPhysRegClass for Reg.
446446
/// \pre Reg is a physical register.
447447
const TargetRegisterClass *
448-
getMinimalPhysRegClass(Register Reg, const TargetRegisterInfo &TRI) const;
448+
getMinimalPhysRegClass(MCRegister Reg, const TargetRegisterInfo &TRI) const;
449449

450450
/// Try to get the mapping of \p MI.
451451
/// See getInstrMapping for more details on what a mapping represents.

llvm/lib/CodeGen/RegisterBankInfo.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,8 @@ RegisterBankInfo::getRegBank(Register Reg, const MachineRegisterInfo &MRI,
100100
}
101101

102102
const TargetRegisterClass *
103-
RegisterBankInfo::getMinimalPhysRegClass(Register Reg,
103+
RegisterBankInfo::getMinimalPhysRegClass(MCRegister Reg,
104104
const TargetRegisterInfo &TRI) const {
105-
assert(Reg.isPhysical() && "Reg must be a physreg");
106105
const auto [RegRCIt, Inserted] = PhysRegMinimalRCs.try_emplace(Reg);
107106
if (Inserted)
108107
RegRCIt->second = TRI.getMinimalPhysRegClassLLT(Reg, LLT());

0 commit comments

Comments
 (0)