[X86] getIntImmCostInst - avoid repeating getNumOperands() in for-loop (style). NFC.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 23 Jul 2023 14:49:22 +0000 (15:49 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 23 Jul 2023 14:49:33 +0000 (15:49 +0100)
llvm/lib/Target/X86/X86TargetTransformInfo.cpp

index 201273a..17981b3 100644 (file)
@@ -5671,15 +5671,15 @@ InstructionCost X86TTIImpl::getGSVectorCost(unsigned Opcode, Type *SrcVTy,
     const Value *Ptrs = GEP->getPointerOperand();
     if (Ptrs->getType()->isVectorTy() && !getSplatValue(Ptrs))
       return IndexSize;
-    for (unsigned i = 1; i < GEP->getNumOperands(); ++i) {
-      if (isa<Constant>(GEP->getOperand(i)))
+    for (unsigned I = 1, E = GEP->getNumOperands(); I != E; ++I) {
+      if (isa<Constant>(GEP->getOperand(I)))
         continue;
-      Type *IndxTy = GEP->getOperand(i)->getType();
+      Type *IndxTy = GEP->getOperand(I)->getType();
       if (auto *IndexVTy = dyn_cast<VectorType>(IndxTy))
         IndxTy = IndexVTy->getElementType();
       if ((IndxTy->getPrimitiveSizeInBits() == 64 &&
-          !isa<SExtInst>(GEP->getOperand(i))) ||
-         ++NumOfVarIndices > 1)
+           !isa<SExtInst>(GEP->getOperand(I))) ||
+          ++NumOfVarIndices > 1)
         return IndexSize; // 64
     }
     return (unsigned)32;