andrew at sidefx.com
2011-Jan-07 06:11 UTC
[LLVMdev] Increasing TargetRegisterInfo::FirstVirtualRegister?
Would it be possible to increase TargetRegisterInfo::FirstVirtualRegister to something quite a bit larger - such as 2^31? I'm working on a target where all SSA values need to be assigned physical registers, and the current limit of 16384 may limit the size of programs that I'm able to handle. 2^31 is a nice value since there are equal numbers of possible physical and virtual registers, and registers can just inspect the high bit to determine if it's a virtual register. My only concern is that there may be data structures using FirstVirtualRegister to size tables rather than using the MachineRegisterInfo limit. Along with this change, I would also propose subtracting FirstVirtualRegister from the printed values of virtual registers, so that what used to be "reg16384" would now show up as "reg0". Andrew
Chris Lattner
2011-Jan-07 06:18 UTC
[LLVMdev] Increasing TargetRegisterInfo::FirstVirtualRegister?
On Jan 6, 2011, at 10:11 PM, andrew at sidefx.com wrote:> Would it be possible to increase TargetRegisterInfo::FirstVirtualRegister > to something quite a bit larger - such as 2^31? I'm working on a target > where all SSA values need to be assigned physical registers, and the > current limit of 16384 may limit the size of programs that I'm able to > handle. 2^31 is a nice value since there are equal numbers of possible > physical and virtual registers, and registers can just inspect the high > bit to determine if it's a virtual register. My only concern is that > there may be data structures using FirstVirtualRegister to size tables > rather than using the MachineRegisterInfo limit.If you're interested in doing this, I'd suggest hacking up the backend to not run register allocation, and represent all your "physical" registers are virtual registers. This gives you an unlimited number. -Chris
andrew at sidefx.com
2011-Jan-07 06:39 UTC
[LLVMdev] Increasing TargetRegisterInfo::FirstVirtualRegister?
> If you're interested in doing this, I'd suggest hacking up the backend to > not run register allocation, and represent all your "physical" registers > are virtual registers. This gives you an unlimited number. >Yes it would be ideal to use all virtual registers, but a glance at the code seemed to indicate the the use of physical registers, spilling, etc. was pretty ingrained in all the register allocation algorithms, so it seemed like it would be difficult to extract. I also still need to minimize the number of registers and minimize copies as if it were generating code for more restrictive hardware. Ideally I'd like something like the linear register allocator but that never spilled or assigned physical registers, along with other goodies like coalescing and phi elimination. On the other hand, just increasing the allowable physical registers would immediately solve most of my problems. Andrew
Maybe Matching Threads
- [LLVMdev] Increasing TargetRegisterInfo::FirstVirtualRegister?
- [LLVMdev] Increasing TargetRegisterInfo::FirstVirtualRegister?
- [LLVMdev] Increasing TargetRegisterInfo::FirstVirtualRegister?
- [LLVMdev] Increasing TargetRegisterInfo::FirstVirtualRegister?
- [LLVMdev] Increasing TargetRegisterInfo::FirstVirtualRegister?