Juan Carlos Martinez Santos
2009-Dec-22 21:47 UTC
[LLVMdev] Eliminating General Purpose Register
Hello, Sound odd, but how I can reduce the amount of GPR available. Is there a place (file) where I let know the compiler how many register it can use? I have planned to used some registers for special purpose, so I want to estimate the cost before to do it. In my project, I cannot add register to the current architecture (I will imply redesign my core - x86based). Thanks in advance, -- Juan Carlos -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20091222/2816fc26/attachment.html>
On Tuesday 22 December 2009 15:47, Juan Carlos Martinez Santos wrote:> Hello, > > Sound odd, but how I can reduce the amount of GPR available. Is there a > place (file) where I let know the compiler how many register it can use? > > I have planned to used some registers for special purpose, so I want to > estimate the cost before to do it. In my project, I cannot add register to > the current architecture (I will imply redesign my core - x86based).X86RegisterInfo.td "allocation_order_[begin/end]" is probably what you want. There is a pair of these APIs for every register class. There may be various special cases scattered throughout the backend that may have to be modified but changing these functions should get the vast majority of them. Just change them so they do not include the registers you want to reserve. You may need to restructure some of the underlying register lists to put your reserved registers at the end. A more general alternative is to put something like a boost::filter_iterator on top of the iterator returned by allocation_order_[begin/end] and have it filter out the reserved registers. I don't know how standard-compliant the register iterators are, however. They may some work in that department to operate with boost::filter_iterator. -Dave
Seemingly Similar Threads
- [LLVMdev] Purpose of PROLOG_LABEL in function prologue?
- [LLVMdev] Purpose of PROLOG_LABEL in function prologue?
- [LLVMdev] [PATCH] RegScavenger::scavengeRegister
- [LLVMdev] [PATCH] RegScavenger::scavengeRegister
- [LLVMdev] Purpose of PROLOG_LABEL in function prologue?