AMDGPU: Fix off-by-one in SIRegisterInfo::eliminateFrameIndex

Description

AMDGPU: Fix off-by-one in SIRegisterInfo::eliminateFrameIndex

Summary:
The method insertNOPs expected the number of wait states to be passed as
parameter, while eliminateFrameIndex passed the immediate argument for the
S_NOP, leading to an off-by-one error. Rename the method to make the
meaning of its parameter clearer. The number of 4 / 5 wait states (which
is what the method has always _tried_ to do according to the comment) is
correct according to the hardware docs.

I stumbled upon this while trying to track down the cause of
https://bugs.freedesktop.org/show_bug.cgi?id=93264. While clearly needed,
this patch unfortunately does not fix that bug...

Reviewers: arsenm, tstellarAMD

Subscribers: arsenm, llvm-commits

Differential Revision: http://reviews.llvm.org/D15542

Details

Committed
nhaDec 17 2015, 8:46 AM
Differential Revision
D15542: AMDGPU: Fix off-by-one in SIRegisterInfo::eliminateFrameIndex
Parents
rL255905: Revert r254592 (virtual dtor in SCEVPredicate).
Branches
Unknown
Tags
Unknown