TableGen/GlobalISel: Don't reconstruct CodeGenRegBank
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 14 Jan 2020 18:48:34 +0000 (13:48 -0500)
committerMatt Arsenault <arsenm2@gmail.com>
Wed, 15 Jan 2020 13:58:57 +0000 (08:58 -0500)
commit3ab7b7f53552a0969bd89db3317eb5a3ddf31d8f
tree77f77906850b6eaa1c4be1430e35b1a1dbf93a9e
parent46e3edcc2c89e34b3ec198387b758a6998f5980b
TableGen/GlobalISel: Don't reconstruct CodeGenRegBank

The maps for dealing with the relationships between different register
classes and subregister indexes rely on unique pointers for every
class/index. By constructing a second copy of CodeGenRegBank, two
different pointer values existed for a given subregister depending on
where you were querying.

Use the existing CodeGenRegBank owned by the CodeGenTarget instead of
constructing a second copy. This avoids incorrectly failing map
lookups in a future change.
llvm/utils/TableGen/GlobalISelEmitter.cpp