This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Changing the number of regs


Rahul Gupta wrote:
I am trying out some register allocators for gcc. For comparison purposes,
I need to change the number of registers to some low number like 8 or 16.

Changing FIRST_PSEUDO_REGISTER requires changing a number of other things also, such as REG_CLASS_CONTENTS, REGISTER_NAMES, etc. This probably is not a practical approach.


Using CONDITIONAL_REGISTER_USAGE to disable regs is a good approach. You can even add options to control which registers get disabled. When you disable a register, you need to set both fixed_regs and call_used_regs. See the examples in the i386.h CONDITIONAL_REGISTER_USAGE macro. If you didn't set call_used_regs, this might explain why you had a problem.

If that doesn't solve your problem, then you need to be a little more explicit about what the problem is. You mentioned you had zero spill cost allocation, but didn't mention how that was computed. Maybe it is getting computed wrong? Or if you are using a number that gcc generated internally, maybe the number doesn't mean what you think it means?
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]