[RegisterBankInfo] Keep valid pointers for PartialMappings.
authorQuentin Colombet <qcolombet@apple.com>
Sat, 24 Sep 2016 04:53:48 +0000 (04:53 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Sat, 24 Sep 2016 04:53:48 +0000 (04:53 +0000)
commit8159de4de9508e20dbfd77c8c72394dba608aa63
treee22301a7953b12060ee829de34aab23fc68c1f35
parentfbc4d68e71357eb5ace83ed09b8d6fda86794a0c
[RegisterBankInfo] Keep valid pointers for PartialMappings.

Previously we were using the address of the unique instance of a partial
mapping in the related map to access this instance. However, when the
map grows, the whole set of instances may be moved elsewhere and the
previous addresses are not valid anymore.

Instead, keep the address of the unique heap allocated instance of a
partial mapping.

Note: I did not see any actual bugs for that problem as the number of
partial mappings dynamically allocated is small (<= 4).

llvm-svn: 282323
llvm/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h
llvm/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp