Skip to content

Commit 60f3fdd

Browse files
authored
[RISCV][Outliner] Use MCRegister. NFC (llvm#128291)
1 parent 2c00b3b commit 60f3fdd

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@ static inline unsigned getVLOpNum(const MCInstrDesc &Desc) {
200200
return Desc.getNumOperands() - Offset;
201201
}
202202

203-
static inline unsigned getTailExpandUseRegNo(const FeatureBitset &FeatureBits) {
203+
static inline MCRegister
204+
getTailExpandUseRegNo(const FeatureBitset &FeatureBits) {
204205
// For Zicfilp, PseudoTAIL should be expanded to a software guarded branch.
205206
// It means to use t2(x7) as rs1 of JALR to expand PseudoTAIL.
206207
return FeatureBits[RISCV::FeatureStdExtZicfilp] ? RISCV::X7 : RISCV::X6;

llvm/lib/Target/RISCV/RISCVInstrInfo.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2984,13 +2984,13 @@ static bool isCandidatePatchable(const MachineBasicBlock &MBB) {
29842984
}
29852985

29862986
static bool isMIReadsReg(const MachineInstr &MI, const TargetRegisterInfo *TRI,
2987-
unsigned RegNo) {
2987+
MCRegister RegNo) {
29882988
return MI.readsRegister(RegNo, TRI) ||
29892989
MI.getDesc().hasImplicitUseOfPhysReg(RegNo);
29902990
}
29912991

29922992
static bool isMIModifiesReg(const MachineInstr &MI,
2993-
const TargetRegisterInfo *TRI, unsigned RegNo) {
2993+
const TargetRegisterInfo *TRI, MCRegister RegNo) {
29942994
return MI.modifiesRegister(RegNo, TRI) ||
29952995
MI.getDesc().hasImplicitDefOfPhysReg(RegNo);
29962996
}
@@ -3005,7 +3005,7 @@ static bool cannotInsertTailCall(const MachineBasicBlock &MBB) {
30053005
// that can be used for expanding PseudoTAIL instruction,
30063006
// then we cannot insert tail call.
30073007
const TargetSubtargetInfo &STI = MBB.getParent()->getSubtarget();
3008-
unsigned TailExpandUseRegNo =
3008+
MCRegister TailExpandUseRegNo =
30093009
RISCVII::getTailExpandUseRegNo(STI.getFeatureBits());
30103010
for (const MachineInstr &MI : MBB) {
30113011
if (isMIReadsReg(MI, STI.getRegisterInfo(), TailExpandUseRegNo))

0 commit comments

Comments
 (0)