OSDN Git Service

Remove unnecessary call to getAllocatableRegClass
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 10 Nov 2015 00:30:14 +0000 (00:30 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 10 Nov 2015 00:30:14 +0000 (00:30 +0000)
commit76916424bef4b5043d90e2f2dd15fb3dda9c029e
tree2ffc2d0cfffe6453e44dde09a34346eee3d70225
parentbcd8e0aae7dc4eea0ff0a425ba164db10c4dcb71
Remove unnecessary call to getAllocatableRegClass

I'm not sure what the point of this was. I'm not sure why
you would ever define an instruction that produces an unallocatable
register class. No tests fail with this removed, and it seems like
it should be a verifier error to define such an instruction.

This was problematic for AMDGPU because it would make bad decisions
by arbitrarily changing the register class when unsetting isAllocatable
for VS_32/VS_64, which is currently set as a workaround to this problem.

AMDGPU uses the VS_32/VS_64 register classes to represent operands which
can use either VGPRs or SGPRs. When  isAllocatable is unset for these,
this would need to pick  either the SGPR or VGPR class and insert either
a copy we don't want, or an illegal copy we would need to deal with
later. A semi-arbitrary register class ordering decision is made in tablegen,
which resulted in always picking a VGPR class because it happens to have
more registers than the SGPR register class. We really just want to
use whatever register class the original register had.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252565 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/InstrEmitter.cpp