Movatterモバイル変換


[0]ホーム

URL:


Next:, Previous:, Up:Register Usage   [Contents][Index]


17.7.2 Order of Allocation of Registers

Registers are allocated in order.

Macro:REG_ALLOC_ORDER

If defined, an initializer for a vector of integers, containing thenumbers of hard registers in the order in which GCC should preferto use them (from most preferred to least).

If this macro is not defined, registers are used lowest numbered first(all else being equal).

One use of this macro is on machines where the highest numberedregisters must always be saved and the save-multiple-registersinstruction supports only sequences of consecutive registers. On suchmachines, defineREG_ALLOC_ORDER to be an initializer that liststhe highest numbered allocable register first.

Macro:ADJUST_REG_ALLOC_ORDER

A C statement (sans semicolon) to choose the order in which to allocatehard registers for pseudo-registers local to a basic block.

Store the desired register order in the arrayreg_alloc_order.Element 0 should be the register to allocate first; element 1, the nextregister; and so on.

The macro body should not assume anything about the contents ofreg_alloc_order before execution of the macro.

On most machines, it is not necessary to define this macro.

Macro:HONOR_REG_ALLOC_ORDER

Normally, IRA tries to estimate the costs for saving a register in theprologue and restoring it in the epilogue. This discourages it fromusing call-saved registers. If a machine wants to ensure that IRAallocates registers in the order given by REG_ALLOC_ORDER even if somecall-saved registers appear earlier than call-used ones, then define thismacro as a C expression to nonzero. Default is 0.

Macro:IRA_HARD_REGNO_ADD_COST_MULTIPLIER(regno)

In some case register allocation order is not enough for theIntegrated Register Allocator (IRA) to generate a good code.If this macro is defined, it should return a floating point valuebased onregno. The cost of usingregno for a pseudo willbe increased by approximately the pseudo’s usage frequency times thevalue returned by this macro. Not defining this macro is equivalentto having it always return0.0.

On most machines, it is not necessary to define this macro.


Next:How Values Fit in Registers, Previous:Basic Characteristics of Registers, Up:Register Usage   [Contents][Index]


[8]ページ先頭

©2009-2026 Movatter.jp