Skip to content

Commit edbebda

Browse files
authored
[AMDGPU] Assert previous SGPR exists when bundling preloaded args (llvm#118802)
This came up from a downstream static analysis tool.
1 parent f7ff3cd commit edbebda

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

llvm/lib/Target/AMDGPU/SIISelLowering.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2537,6 +2537,7 @@ void SITargetLowering::allocatePreloadKernArgSGPRs(
25372537

25382538
// Arg is preloaded into the previous SGPR.
25392539
if (ArgLoc.getLocVT().getStoreSize() < 4 && Alignment < 4) {
2540+
assert(InIdx >= 1 && "No previous SGPR");
25402541
Info.getArgInfo().PreloadKernArgs[InIdx].Regs.push_back(
25412542
Info.getArgInfo().PreloadKernArgs[InIdx - 1].Regs[0]);
25422543
continue;

0 commit comments

Comments
 (0)