Jakob Stoklund Olesen
2012-Dec-19 21:40 UTC
[LLVMdev] LLVM ERROR: ran out of registers during register allocation
On Dec 19, 2012, at 8:58 AM, Borja Ferrer <borja.ferav at gmail.com> wrote:> Hello Jakob, > > I think I've found something interesting that may help you get a better idea of what's going on. > > While looking at the debug info I noticed that the coalescer was removing lots of copies that could help the allocator make more cross class copies. As a test, I disabled the join-liveintervals option in the coalescer which gave me the surprise of making the regalloc succeed. To show what I mean, I'm attaching two text files that show the debug info generated when this option is enabled and disabled for my target. > > To push things a bit further, I wrote a dirty hack in RegisterCoalescer::joinCopy() to return false when the dest regclass is too constrained. This allowed me executing the coalescer without crashing the regalloc. Obviously the generated code is not optimal at all, because there are many useless copies around. I'm pretty sure this is not the right fix at all, but it can give you a hint incase the problem is in the coalescer and not in the regalloc.We did something like this back when the register allocator couldn't split live ranges. The problem is that any heuristic you can come up with only makes the problem less likely to happen. It doesn't actually fix it. /jakob
Borja Ferrer
2012-Dec-19 22:21 UTC
[LLVMdev] LLVM ERROR: ran out of registers during register allocation
> > We did something like this back when the register allocator couldn't split > live ranges. >Yes, I remember the isWinToJoinCrossClass() function, removed here: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp?r1=152016&r2=155551&diff_format=h that prevented some coalescing to the cost of leaving many unnecessary copies around for very constrained regclasses like the one I have.> > The problem is that any heuristic you can come up with only makes the > problem less likely to happen. It doesn't actually fix it. >Indeed, that heuristic I wrote is a nasty hack and not the way of fixing it correctly. Now that the regalloc has much more freedom on making changes in the code I hope it is fixable. If you need any other info apart of the dumps I've already attached please ask. Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121219/ec484581/attachment.html>
Borja Ferrer
2013-Jan-07 12:58 UTC
[LLVMdev] LLVM ERROR: ran out of registers during register allocation
Hello Jakob, Did you get a chance to take a look into this, and if not, can you do it when you get some spare time? Thanks! 2012/12/19 Borja Ferrer <borja.ferav at gmail.com>> We did something like this back when the register allocator couldn't split >> live ranges. >> > > Yes, I remember the isWinToJoinCrossClass() function, removed here: > > http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp?r1=152016&r2=155551&diff_format=h > that prevented some coalescing to the cost of leaving many unnecessary > copies around for very constrained regclasses like the one I have. > > >> >> The problem is that any heuristic you can come up with only makes the >> problem less likely to happen. It doesn't actually fix it. >> > > Indeed, that heuristic I wrote is a nasty hack and not the way of fixing > it correctly. Now that the regalloc has much more freedom on making changes > in the code I hope it is fixable. If you need any other info apart of the > dumps I've already attached please ask. > > Thanks! > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130107/200d3d4e/attachment.html>
Reasonably Related Threads
- [LLVMdev] LLVM ERROR: ran out of registers during register allocation
- [LLVMdev] LLVM ERROR: ran out of registers during register allocation
- [LLVMdev] LLVM ERROR: ran out of registers during register allocation
- [LLVMdev] LLVM ERROR: ran out of registers during register allocation
- [LLVMdev] LLVM ERROR: ran out of registers during register allocation