[llvm] 494c637 - MachineInstrBundle: modernize a couple of loops (NFC) (#89229)

via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 19 02:01:54 PDT 2024


Author: Ramkumar Ramachandra
Date: 2024-04-19T10:01:51+01:00
New Revision: 494c637816e4787752ae3bf29be618ffdc92f4cd

URL: https://github.com/llvm/llvm-project/commit/494c637816e4787752ae3bf29be618ffdc92f4cd
DIFF: https://github.com/llvm/llvm-project/commit/494c637816e4787752ae3bf29be618ffdc92f4cd.diff

LOG: MachineInstrBundle: modernize a couple of loops (NFC) (#89229)

Added: 
    

Modified: 
    llvm/lib/CodeGen/MachineInstrBundle.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/MachineInstrBundle.cpp b/llvm/lib/CodeGen/MachineInstrBundle.cpp
index 6eeed8b5c3f7de..dafa8e2527f6d9 100644
--- a/llvm/lib/CodeGen/MachineInstrBundle.cpp
+++ b/llvm/lib/CodeGen/MachineInstrBundle.cpp
@@ -312,8 +312,7 @@ llvm::AnalyzeVirtRegLanesInBundle(const MachineInstr &MI, Register Reg,
 
   LaneBitmask UseMask, DefMask;
 
-  for (ConstMIBundleOperands O(MI); O.isValid(); ++O) {
-    const MachineOperand &MO = *O;
+  for (const MachineOperand &MO : const_mi_bundle_ops(MI)) {
     if (!MO.isReg() || MO.getReg() != Reg)
       continue;
 
@@ -339,9 +338,7 @@ PhysRegInfo llvm::AnalyzePhysRegInBundle(const MachineInstr &MI, Register Reg,
   PhysRegInfo PRI = {false, false, false, false, false, false, false, false};
 
   assert(Reg.isPhysical() && "analyzePhysReg not given a physical register!");
-  for (ConstMIBundleOperands O(MI); O.isValid(); ++O) {
-    const MachineOperand &MO = *O;
-
+  for (const MachineOperand &MO : const_mi_bundle_ops(MI)) {
     if (MO.isRegMask() && MO.clobbersPhysReg(Reg)) {
       PRI.Clobbered = true;
       continue;


        


More information about the llvm-commits mailing list