@@ -1041,10 +1041,9 @@ unsigned MachineInstr::getBundleSize() const {
1041
1041
// / Returns true if the MachineInstr has an implicit-use operand of exactly
1042
1042
// / the given register (not considering sub/super-registers).
1043
1043
bool MachineInstr::hasRegisterImplicitUseOperand (Register Reg) const {
1044
- for (const MachineOperand &MO : operands ()) {
1045
- if (MO.isReg () && MO. isUse () && MO. isImplicit () && MO.getReg () == Reg)
1044
+ for (const MachineOperand &MO : all_uses ())
1045
+ if (MO.isImplicit () && MO.getReg () == Reg)
1046
1046
return true ;
1047
- }
1048
1047
return false ;
1049
1048
}
1050
1049
@@ -1264,10 +1263,8 @@ unsigned MachineInstr::findTiedOperandIdx(unsigned OpIdx) const {
1264
1263
// / clearKillInfo - Clears kill flags on all operands.
1265
1264
// /
1266
1265
void MachineInstr::clearKillInfo () {
1267
- for (MachineOperand &MO : operands ()) {
1268
- if (MO.isReg () && MO.isUse ())
1269
- MO.setIsKill (false );
1270
- }
1266
+ for (MachineOperand &MO : all_uses ())
1267
+ MO.setIsKill (false );
1271
1268
}
1272
1269
1273
1270
void MachineInstr::substituteRegister (Register FromReg, Register ToReg,
@@ -1549,12 +1546,9 @@ bool MachineInstr::isLoadFoldBarrier() const {
1549
1546
// / allDefsAreDead - Return true if all the defs of this instruction are dead.
1550
1547
// /
1551
1548
bool MachineInstr::allDefsAreDead () const {
1552
- for (const MachineOperand &MO : operands ()) {
1553
- if (!MO.isReg () || MO.isUse ())
1554
- continue ;
1549
+ for (const MachineOperand &MO : all_defs ())
1555
1550
if (!MO.isDead ())
1556
1551
return false ;
1557
- }
1558
1552
return true ;
1559
1553
}
1560
1554
@@ -2063,8 +2057,8 @@ void MachineInstr::clearRegisterKills(Register Reg,
2063
2057
const TargetRegisterInfo *RegInfo) {
2064
2058
if (!Reg.isPhysical ())
2065
2059
RegInfo = nullptr ;
2066
- for (MachineOperand &MO : operands ()) {
2067
- if (!MO.isReg () || !MO. isUse () || !MO. isKill ())
2060
+ for (MachineOperand &MO : all_uses ()) {
2061
+ if (!MO.isKill ())
2068
2062
continue ;
2069
2063
Register OpReg = MO.getReg ();
2070
2064
if ((RegInfo && RegInfo->regsOverlap (Reg, OpReg)) || Reg == OpReg)
0 commit comments