[AMDGPU] Fix VGPR spills where offset doesn't fit in 12 bits
authorScott Linder <scott@scottlinder.com>
Thu, 26 Jul 2018 19:47:51 +0000 (19:47 +0000)
committerScott Linder <scott@scottlinder.com>
Thu, 26 Jul 2018 19:47:51 +0000 (19:47 +0000)
commiteb1f75d561762123224c17b763f68def84a05715
treec179aebdeab30fc69f5db24ff1c9bcb711d9fe32
parent6d6eab66e0f76c8bb908492dcc863308b66f7771
[AMDGPU] Fix VGPR spills where offset doesn't fit in 12 bits

Scale the offset of VGPR spills by the wave size when it cannot fit in the
12-bit offset immediate field and so is added to the soffset SGPR. This
accounts for hardware swizzling of scratch memory.

Differential Revision: https://reviews.llvm.org/D49448

llvm-svn: 338060
llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
llvm/test/CodeGen/AMDGPU/spill-offset-calculation.ll [new file with mode: 0644]