Remove MachineRegisterInfo::getLastVirtReg(), it was giving wrong results
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Sun, 9 Jan 2011 21:58:20 +0000 (21:58 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Sun, 9 Jan 2011 21:58:20 +0000 (21:58 +0000)
commit42e9c963921776cb498c33b6c6c03f29971316f3
tree0e3b29c341c27f498cd008f35d90e8d27b099c4c
parent9dddf08eb8851e7c707df7f36b18e4e738e717cc
Remove MachineRegisterInfo::getLastVirtReg(), it was giving wrong results
when no virtual registers have been allocated.

It was only used to resize IndexedMaps, so provide an IndexedMap::resize()
method such that

 Map.grow(MRI.getLastVirtReg());

can be replaced with the simpler

 Map.resize(MRI.getNumVirtRegs());

This works correctly when no virtuals are allocated, and it bypasses the to/from
index conversions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123130 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/IndexedMap.h
include/llvm/CodeGen/MachineRegisterInfo.h
lib/CodeGen/RegAllocFast.cpp
lib/CodeGen/VirtRegMap.cpp