Skip to content

Commit b29ea41

Browse files
rampitecgithub-actions[bot]
authored andcommitted
Automerge: [AMDGPU] Fix out of bound physreg tuple condition. NFC. (#152777)
The end register of the tuple shall be below the last existing register. The check does not work on something like {v[255:256]}. Overall it works correctly because if fails later at the getMatchingSuperReg() call.
2 parents e0df76d + 10e146a commit b29ea41

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Target/AMDGPU/SIISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16925,7 +16925,7 @@ SITargetLowering::getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI_,
1692516925

1692616926
if (RC) {
1692716927
if (NumRegs > 1) {
16928-
if (Idx >= RC->getNumRegs() || Idx + NumRegs - 1 > RC->getNumRegs())
16928+
if (Idx >= RC->getNumRegs() || Idx + NumRegs - 1 >= RC->getNumRegs())
1692916929
return std::pair(0U, nullptr);
1693016930

1693116931
uint32_t Width = NumRegs * 32;

0 commit comments

Comments
 (0)