[LLVMdev] Balancing the registers

Owen Anderson resistor at mac.com
Wed Jul 30 13:02:18 PDT 2014


Hi Volkan,

Take a look at the TargetRegisterInfo::getRegAllocationHints() callback.  This callback allows you to, at the time RA wants to assign a physical register to a virtual register, return a prioritized list of registers it should consider.  For your situation, you could look at any physical registers already assigned to the same instruction and return a prioritized list based on that.  Be careful of over using this, as you can end up regressing code quality or compile time if you send RA down a pointless rabbit hole too often.

—Owen

On Jul 30, 2014, at 7:11 AM, Volkan Keleş <vlknkls at gmail.com> wrote:

> Hi,
> 
> In our custom device, we keep the registers in two different places, one for the odd-numbered registers and one for the even-numbered registers. To fetch the data quickly, the registers in an instruction should be balanced. For example, if an instruction contains 2 odd-numbered regs and 2 even-numbered regs, they can be fetched in one cycle.
> 
> Is it possible to enforce LLC to balance the registers as above?
> 
> Volkan
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev





More information about the llvm-dev mailing list