[llvm] r270236 - use range-loops; NFCI

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Fri May 20 10:00:11 PDT 2016


Author: spatel
Date: Fri May 20 12:00:10 2016
New Revision: 270236

URL: http://llvm.org/viewvc/llvm-project?rev=270236&view=rev
Log:
use range-loops; NFCI

Modified:
    llvm/trunk/lib/Target/X86/X86VZeroUpper.cpp

Modified: llvm/trunk/lib/Target/X86/X86VZeroUpper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86VZeroUpper.cpp?rev=270236&r1=270235&r2=270236&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86VZeroUpper.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86VZeroUpper.cpp Fri May 20 12:00:10 2016
@@ -128,8 +128,7 @@ static bool clobbersAllYmmRegs(const Mac
 }
 
 static bool hasYmmReg(MachineInstr *MI) {
-  for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
-    const MachineOperand &MO = MI->getOperand(i);
+  for (const MachineOperand &MO : MI->operands()) {
     if (MI->isCall() && MO.isRegMask() && !clobbersAllYmmRegs(MO))
       return true;
     if (!MO.isReg())
@@ -145,8 +144,7 @@ static bool hasYmmReg(MachineInstr *MI)
 /// Check if any YMM register will be clobbered by this instruction.
 static bool callClobbersAnyYmmReg(MachineInstr *MI) {
   assert(MI->isCall() && "Can only be called on call instructions.");
-  for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
-    const MachineOperand &MO = MI->getOperand(i);
+  for (const MachineOperand &MO : MI->operands()) {
     if (!MO.isRegMask())
       continue;
     for (unsigned reg = X86::YMM0; reg <= X86::YMM15; ++reg) {




More information about the llvm-commits mailing list