How Register allocator called in LLVM


I want to understand how register allocation is performed on LLVM. For
a program, how often the register allocator is called? Does it divide
the code in to different sections and call the register allocator?

Also can someone point me to the code where register allocator is
called in the compilation process.