[llvm] [RegAllocFast] NFC cleanups (PR #74860)
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 8 09:50:18 PST 2023
================
@@ -1241,21 +1250,14 @@ void RegAllocFast::allocateInstruction(MachineInstr &MI) {
RegMasks.clear();
BundleVirtRegsMap.clear();
- auto TiedOpIsUndef = [&](const MachineOperand &MO, unsigned Idx) {
- assert(MO.isTied());
- unsigned TiedIdx = MI.findTiedOperandIdx(Idx);
- const MachineOperand &TiedMO = MI.getOperand(TiedIdx);
- return TiedMO.isUndef();
- };
// Scan for special cases; Apply pre-assigned register defs to state.
bool HasPhysRegUse = false;
bool HasRegMask = false;
bool HasVRegDef = false;
bool HasDef = false;
bool HasEarlyClobber = false;
bool NeedToAssignLiveThroughs = false;
- for (unsigned I = 0; I < MI.getNumOperands(); ++I) {
- MachineOperand &MO = MI.getOperand(I);
+ for (MachineOperand &MO : MI.operands()) {
----------------
MatzeB wrote:
This feels like it was intentional, especially given it is not even storing `MI.getNumOperands()` in a variable. And in fact `git blame` points to this: https://reviews.llvm.org/D124834
https://github.com/llvm/llvm-project/pull/74860
More information about the llvm-commits
mailing list