[MachineRegisterInfo] Track register bank for virtual registers.
authorQuentin Colombet <qcolombet@apple.com>
Thu, 7 Apr 2016 17:20:29 +0000 (17:20 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Thu, 7 Apr 2016 17:20:29 +0000 (17:20 +0000)
commitc33085f2c62f3aa466ae6f8e288493c10e829e2f
treebe9ccdd9aca6f2f69905a555529bfafab1fac0a0
parentd21115876c85809860f82b1e7dc83f7c36de4b45
[MachineRegisterInfo] Track register bank for virtual registers.
A virtual register may have either a register bank or a register class.
This is represented by a PointerUnion between the related classes.

Typically, a virtual register went through the following states
regarding register class and register bank:

1. Creation: None is set. Virtual registers are fully generic.
2. Register bank assignment: Register bank is set. Virtual registers
live into a register bank, but we do not know the constraints they need
to fulfil.
3. Instruction selection: Register class is set. Virtual registers are
bound by encoding constraints.

To map these states to GlobalISel, the IRTranslator implements #1,
RegBankSelect #2, and Select #3.

llvm-svn: 265696
llvm/include/llvm/CodeGen/MachineRegisterInfo.h
llvm/lib/CodeGen/MachineRegisterInfo.cpp