AMDGPU/SI: Improve register allocation hints for sopk instructions
authorTom Stellard <thomas.stellard@amd.com>
Mon, 29 Aug 2016 13:06:10 +0000 (13:06 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Mon, 29 Aug 2016 13:06:10 +0000 (13:06 +0000)
commit5d3f71f721273e17412dcb3a1726235aabc65651
treeb8e524db082bbe2b138d338c1c0b1595075ea2a4
parent412a52955164c6b06dfc3d56264aea4652f6ec25
AMDGPU/SI: Improve register allocation hints for sopk instructions

Summary:
For shrinking SOPK instructions, we were creating a hint to tell the
register allocator to use the register allocated for src0 for the dst
operand as well.  However, this seems to not work sometimes depending
on the order virtual registers are assigned physical registers.

To fix this, I've added a second allocation hint which does the reverse,
asks that the register allocated for dst is used for src0.

Reviewers: arsenm

Subscribers: arsenm, llvm-commits, kzhuravl

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

llvm-svn: 279968
llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
llvm/test/CodeGen/AMDGPU/shl_add_constant.ll