[RegisterClassInfo] Use SmallVector::assign instead of resize to make sure we erase...
authorCraig Topper <craig.topper@gmail.com>
Thu, 2 Jan 2020 01:30:05 +0000 (17:30 -0800)
committerCraig Topper <craig.topper@gmail.com>
Thu, 2 Jan 2020 02:53:12 +0000 (18:53 -0800)
commitdac98a22052eac66295ce443eed20e21bf37d28d
tree860ca95f767269ad0d8ff0d2973df63064c310e0
parent2fcf7691dfb470e57a940e3a045695515fb44e13
[RegisterClassInfo] Use SmallVector::assign instead of resize to make sure we erase previous contents from all entries of the vector.

resize only writes to elements that get added. Any elements that
already existed maintain their previous value. In this case we're
trying to erase cached information so we should use assign which
will write to every element.

Found while trying to add new tests to an existing X86 test and
 noticed register allocation changing in other functions.
llvm/lib/CodeGen/RegisterClassInfo.cpp