Register allocation is the task of assigning physical registers to virtual registers. Virtual registers can be infinite, but the physical registers for a machine are limited. So, register allocation is aimed at maximizing the number of physical registers getting assigned to virtual registers. In this recipe, we will see how registers are represented in LLVM, how can we tinker with the register information, the steps taking place, and built-in register allocators.
You need to build and install LLVM.
build-folder/lib/Target/X86/X86GenRegisterInfo.incfile and check out the first few lines, which show that registers are represented as integers: