R600/SI: Use VSrc_* register classes as the default classes for types
authorTom Stellard <thomas.stellard@amd.com>
Tue, 6 Aug 2013 23:08:28 +0000 (23:08 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Tue, 6 Aug 2013 23:08:28 +0000 (23:08 +0000)
commit3492eefa4b2509c87598678a6977074a3f6a50e6
tree6e479880fecb17ad357750d49759395f7cf2dd0a
parent3406d882c02a6cd1e16f4636351c23dcb68d785f
R600/SI: Use VSrc_* register classes as the default classes for types

Since the VSrc_* register classes contain both VGPRs and SGPRs, copies
that used be emitted by isel like this:

SGPR = COPY VGPR

Will now be emitted like this:

VSrC = COPY VGPR

This patch also adds a pass that tries to identify and fix situations where
a VGPR to SGPR copy may occur.  Hopefully, these changes will make it
impossible for the compiler to generate illegal VGPR to SGPR copies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187831 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/R600/AMDGPU.h
lib/Target/R600/AMDGPUISelDAGToDAG.cpp
lib/Target/R600/AMDGPUTargetMachine.cpp
lib/Target/R600/SIFixSGPRCopies.cpp [new file with mode: 0644]
lib/Target/R600/SIISelLowering.cpp
test/CodeGen/R600/sgpr-copy.ll [new file with mode: 0644]