Replace subregister uses when processing tied operands
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Fri, 26 Aug 2016 06:31:32 +0000 (06:31 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Fri, 26 Aug 2016 06:31:32 +0000 (06:31 +0000)
commitf403df38eb6b4a1384e60c4ccc14c55084ddb282
tree3cecc4a1d2b9f5fc06ef0e9013caf55bc8e22507
parent041b804a9f0097953d3767196fc539d2940ecde4
Replace subregister uses when processing tied operands

This was for some reason skipping operands that are subregisters
instead of keeping the same subregister index.

v_movreld_b32 expects src0 to be the subregister of the tied
super register use/def.

e.g.

v_movreld_b32 v0, v9, <imp-def, tied3> v[0:3], <imp-use, tied2> v[0:3]

was being replaced with

v[4:7] = copy v[0:3]
v_movreld_b32 v0, v9, <imp-def, tied3> v[4:7], <imp-use, tied2> v[4:7],

which really writes to v[0:3]

llvm-svn: 279804
llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
llvm/test/CodeGen/AMDGPU/indirect-addressing-si-noopt.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/indirect-addressing-si.ll