Skip to content

Commit 6440e16

Browse files
committed
fixup! consistently use isValid.
1 parent 3c9b194 commit 6440e16

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

llvm/lib/Target/RISCV/RISCVFrameLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1560,7 +1560,7 @@ static MCRegister getRVVBaseRegister(const RISCVRegisterInfo &TRI,
15601560
MCRegister BaseReg = TRI.getSubReg(Reg, RISCV::sub_vrm1_0);
15611561
// If it's not a grouped vector register, it doesn't have subregister, so
15621562
// the base register is just itself.
1563-
if (!BaseReg)
1563+
if (!BaseReg.isValid())
15641564
BaseReg = Reg;
15651565
return BaseReg;
15661566
}

llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ static bool hasUndefinedPassthru(const MachineInstr &MI) {
128128
// All undefined passthrus should be $noreg: see
129129
// RISCVDAGToDAGISel::doPeepholeNoRegPassThru
130130
const MachineOperand &UseMO = MI.getOperand(UseOpIdx);
131-
return !UseMO.getReg() || UseMO.isUndef();
131+
return !UseMO.getReg().isValid() || UseMO.isUndef();
132132
}
133133

134134
/// Return true if \p MI is a copy that will be lowered to one or more vmvNr.vs.

llvm/lib/Target/RISCV/RISCVInstrInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1364,7 +1364,7 @@ void RISCVInstrInfo::insertIndirectBranch(MachineBasicBlock &MBB,
13641364
RS->scavengeRegisterBackwards(RISCV::GPRRegClass, MI.getIterator(),
13651365
/*RestoreAfter=*/false, /*SpAdj=*/0,
13661366
/*AllowSpill=*/false);
1367-
if (TmpGPR)
1367+
if (TmpGPR.isValid())
13681368
RS->setRegUsed(TmpGPR);
13691369
else {
13701370
// The case when there is no scavenged register needs special handling.

llvm/lib/Target/RISCV/RISCVVectorPeephole.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ bool RISCVVectorPeephole::convertAllOnesVMergeToVMv(MachineInstr &MI) const {
382382
// vmv.v.v doesn't have a mask operand, so we may be able to inflate the
383383
// register class for the destination and passthru operands e.g. VRNoV0 -> VR
384384
MRI->recomputeRegClass(MI.getOperand(0).getReg());
385-
if (MI.getOperand(1).getReg())
385+
if (MI.getOperand(1).getReg().isValid())
386386
MRI->recomputeRegClass(MI.getOperand(1).getReg());
387387
return true;
388388
}
@@ -467,7 +467,7 @@ bool RISCVVectorPeephole::convertSameMaskVMergeToVMv(MachineInstr &MI) {
467467
// vmv.v.v doesn't have a mask operand, so we may be able to inflate the
468468
// register class for the destination and passthru operands e.g. VRNoV0 -> VR
469469
MRI->recomputeRegClass(MI.getOperand(0).getReg());
470-
if (MI.getOperand(1).getReg())
470+
if (MI.getOperand(1).getReg().isValid())
471471
MRI->recomputeRegClass(MI.getOperand(1).getReg());
472472
return true;
473473
}
@@ -576,7 +576,7 @@ static bool dominates(MachineBasicBlock::const_iterator A,
576576
bool RISCVVectorPeephole::ensureDominates(const MachineOperand &MO,
577577
MachineInstr &Src) const {
578578
assert(MO.getParent()->getParent() == Src.getParent());
579-
if (!MO.isReg() || !MO.getReg())
579+
if (!MO.isReg() || !MO.getReg().isValid())
580580
return true;
581581

582582
MachineInstr *Def = MRI->getVRegDef(MO.getReg());
@@ -672,7 +672,7 @@ bool RISCVVectorPeephole::foldVMV_V_V(MachineInstr &MI) {
672672
if (SrcPassthru.getReg() != Passthru.getReg()) {
673673
SrcPassthru.setReg(Passthru.getReg());
674674
// If Src is masked then its passthru needs to be in VRNoV0.
675-
if (Passthru.getReg())
675+
if (Passthru.getReg().isValid())
676676
MRI->constrainRegClass(
677677
Passthru.getReg(),
678678
TII->getRegClass(Src->getDesc(), SrcPassthru.getOperandNo(), TRI));

0 commit comments

Comments
 (0)