[llvm-branch-commits] [llvm] 467e916 - Fix gcc5 build failure (NFC)
Mehdi Amini via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Jan 7 12:16:16 PST 2021
Author: Mehdi Amini
Date: 2021-01-07T20:11:57Z
New Revision: 467e916d3032bc068995aa1b6b16655eb573e750
URL: https://github.com/llvm/llvm-project/commit/467e916d3032bc068995aa1b6b16655eb573e750
DIFF: https://github.com/llvm/llvm-project/commit/467e916d3032bc068995aa1b6b16655eb573e750.diff
LOG: Fix gcc5 build failure (NFC)
The loop index was shadowing the container name.
It seems that we can just not use a for-range loop here since there is
an induction variable anyway.
Differential Revision: https://reviews.llvm.org/D94254
Added:
Modified:
llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp b/llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp
index 12b9688c2ee0..3b6e263ee6d8 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp
@@ -330,11 +330,11 @@ void AMDGPUCallLowering::processSplitArgs(
// 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 &CurSplitArg = SplitArg[SplitIdx];
Register Reg = OrigArg.Regs[SplitIdx];
- EVT VT = EVT::getEVT(SplitArg.Ty);
- LLT LLTy = getLLTForType(*SplitArg.Ty, DL);
+ EVT VT = EVT::getEVT(CurSplitArg.Ty);
+ LLT LLTy = getLLTForType(*CurSplitArg.Ty, DL);
unsigned NumParts = TLI.getNumRegistersForCallingConv(Ctx, CallConv, VT);
MVT RegVT = TLI.getRegisterTypeForCallingConv(Ctx, CallConv, VT);
@@ -342,9 +342,8 @@ void AMDGPUCallLowering::processSplitArgs(
if (NumParts == 1) {
// 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;
+ SplitArgs.emplace_back(Reg, CurSplitArg.Ty, OrigArg.Flags,
+ OrigArg.IsFixed);
continue;
}
@@ -362,8 +361,6 @@ void AMDGPUCallLowering::processSplitArgs(
}
PerformArgSplit(SplitRegs, Reg, LLTy, PartLLT, SplitIdx);
-
- ++SplitIdx;
}
}
More information about the llvm-branch-commits
mailing list