diff --git a/llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp b/llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp --- a/llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp @@ -335,8 +335,8 @@ // FIXME: This is mostly nasty pre-processing before handleAssignments. Most // of this should be performed by handleAssignments. - int SplitIdx = 0; - for (const ArgInfo &SplitArg : SplitArg) { + for (int SplitIdx = 0, e = SplitArg.size(); SplitIdx != e; ++SplitIdx) { + const ArgInfo &SplitArg = SplitArg[SplitIdx]; Register Reg = OrigArg.Regs[SplitIdx]; EVT VT = EVT::getEVT(SplitArg.Ty); LLT LLTy = getLLTForType(*SplitArg.Ty, DL); @@ -348,8 +348,6 @@ // No splitting to do, but we want to replace the original type (e.g. [1 x // double] -> double). SplitArgs.emplace_back(Reg, SplitArg.Ty, OrigArg.Flags, OrigArg.IsFixed); - - ++SplitIdx; continue; } @@ -367,8 +365,6 @@ } PerformArgSplit(SplitRegs, Reg, LLTy, PartLLT, SplitIdx); - - ++SplitIdx; } }