[llvm] d7b8cb4 - [X86] X86ISelLowering.cpp - try to use for-range loops. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 5 03:09:30 PST 2021
Author: Simon Pilgrim
Date: 2021-03-05T11:09:14Z
New Revision: d7b8cb4d573c6f87cf47eb5eb20e0d6a6d80cd2d
URL: https://github.com/llvm/llvm-project/commit/d7b8cb4d573c6f87cf47eb5eb20e0d6a6d80cd2d
DIFF: https://github.com/llvm/llvm-project/commit/d7b8cb4d573c6f87cf47eb5eb20e0d6a6d80cd2d.diff
LOG: [X86] X86ISelLowering.cpp - try to use for-range loops. NFCI.
Added:
Modified:
llvm/lib/Target/X86/X86ISelLowering.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index a8e8bd3257b3..1a9259718336 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -2385,8 +2385,8 @@ void X86TargetLowering::markLibCallAttributes(MachineFunction *MF, unsigned CC,
ParamRegs = M->getNumberRegisterParameters();
// Mark the first N int arguments as having reg
- for (unsigned Idx = 0; Idx < Args.size(); Idx++) {
- Type *T = Args[Idx].Ty;
+ for (auto &Arg : Args) {
+ Type *T = Arg.Ty;
if (T->isIntOrPtrTy())
if (MF->getDataLayout().getTypeAllocSize(T) <= 8) {
unsigned numRegs = 1;
@@ -2395,7 +2395,7 @@ void X86TargetLowering::markLibCallAttributes(MachineFunction *MF, unsigned CC,
if (ParamRegs < numRegs)
return;
ParamRegs -= numRegs;
- Args[Idx].IsInReg = true;
+ Arg.IsInReg = true;
}
}
}
@@ -22035,12 +22035,9 @@ static bool matchScalarReduction(SDValue Op, ISD::NodeType BinOp,
SrcMask->push_back(SrcOpMap[SrcOp]);
} else {
// Quit if not all elements are used.
- for (DenseMap<SDValue, APInt>::const_iterator I = SrcOpMap.begin(),
- E = SrcOpMap.end();
- I != E; ++I) {
- if (!I->second.isAllOnesValue())
+ for (const auto &I : SrcOpMap)
+ if (!I.second.isAllOnesValue())
return false;
- }
}
return true;
More information about the llvm-commits
mailing list