GCC Middle and Back End API Reference
ira_loop_border_costs Class Reference

#include <ira-int.h>

Public Member Functions

 ira_loop_border_costs (ira_allocno_t)
int move_between_loops_cost () const
int spill_outside_loop_cost () const
int spill_inside_loop_cost () const

Private Attributes

machine_mode m_mode
reg_class m_class
int m_entry_freq
int m_exit_freq

Detailed Description

Represents the boundary between an allocno in one loop and its parent allocno in the enclosing loop. It is usually possible to change a register's allocation on this boundary; the class provides routines for calculating the cost of such changes.

Constructor & Destructor Documentation

◆ ira_loop_border_costs()

ira_loop_border_costs::ira_loop_border_costs ( ira_allocno_t a)
Construct an object that describes the boundary between A and its parent allocno.

References a, ALLOCNO_CLASS, ALLOCNO_LOOP_TREE_NODE, ALLOCNO_MODE, ALLOCNO_REGNO, false, ira_loop_edge_freq(), m_class, m_entry_freq, m_exit_freq, m_mode, and true.

Member Function Documentation

◆ move_between_loops_cost()

int ira_loop_border_costs::move_between_loops_cost ( ) const
inline
Return the cost of moving the pseudo register between different hard registers on entry and exit from the loop. This is the cost to use if the register is successfully allocated within both this loop and the parent loop, but the allocations for the loops differ.

References ira_init_register_move_cost_if_necessary(), ira_register_move_cost, m_class, m_entry_freq, m_exit_freq, and m_mode.

Referenced by calculate_allocno_spill_cost(), color_pass(), and move_spill_restore().

◆ spill_inside_loop_cost()

int ira_loop_border_costs::spill_inside_loop_cost ( ) const
inline
Return the cost of storing the register on entry to the loop and loading it back on exit from the loop. This is the cost to use if the register is spilled within the loop but is successfully allocated in the parent loop.

References ira_memory_move_cost, m_class, m_entry_freq, m_exit_freq, and m_mode.

Referenced by assign_hard_reg(), calculate_allocno_spill_cost(), color_pass(), improve_allocation(), move_spill_restore(), and propagate_allocno_info().

◆ spill_outside_loop_cost()

int ira_loop_border_costs::spill_outside_loop_cost ( ) const
inline
Return the cost of loading the register on entry to the loop and storing it back on exit from the loop. This is the cost to use if the register is successfully allocated within the loop but is spilled in the parent loop.

References ira_memory_move_cost, m_class, m_entry_freq, m_exit_freq, and m_mode.

Referenced by calculate_allocno_spill_cost(), color_pass(), and move_spill_restore().

Field Documentation

◆ m_class

reg_class ira_loop_border_costs::m_class
private

◆ m_entry_freq

int ira_loop_border_costs::m_entry_freq
private

◆ m_exit_freq

int ira_loop_border_costs::m_exit_freq
private

◆ m_mode

machine_mode ira_loop_border_costs::m_mode
private

The documentation for this class was generated from the following files: