GCC Middle and Back End API Reference
slpg_layout_cost Struct Reference
Collaboration diagram for slpg_layout_cost:

Public Member Functions

 slpg_layout_cost ()=default
 
 slpg_layout_cost (sreal, bool)
 
bool is_possible () const
 
bool operator== (const slpg_layout_cost &) const
 
bool operator!= (const slpg_layout_cost &) const
 
bool is_better_than (const slpg_layout_cost &, bool) const
 
void add_parallel_cost (const slpg_layout_cost &)
 
void add_serial_cost (const slpg_layout_cost &)
 
void split (unsigned int)
 

Static Public Member Functions

static slpg_layout_cost impossible ()
 

Data Fields

sreal depth = 0
 
sreal total = 0
 

Detailed Description

Estimates the cost of inserting layout changes into the SLP graph.
It can also say that the insertion is impossible.   

Constructor & Destructor Documentation

◆ slpg_layout_cost() [1/2]

slpg_layout_cost::slpg_layout_cost ( )
default

◆ slpg_layout_cost() [2/2]

slpg_layout_cost::slpg_layout_cost ( sreal weight,
bool is_for_size )
Construct costs for a node with weight WEIGHT.  A higher weight
indicates more frequent execution.  IS_FOR_SIZE is true if we are
optimizing for size rather than speed.   

Member Function Documentation

◆ add_parallel_cost()

void slpg_layout_cost::add_parallel_cost ( const slpg_layout_cost & input_cost)
Increase the costs to account for something with cost INPUT_COST
happening in parallel with the current costs.   

References depth, ggc_alloc(), and total.

Referenced by vect_optimize_slp_pass::total_in_cost().

◆ add_serial_cost()

void slpg_layout_cost::add_serial_cost ( const slpg_layout_cost & other)
Increase the costs to account for something with cost INPUT_COST
happening in series with the current costs.   

References depth, and total.

Referenced by vect_optimize_slp_pass::backward_cost(), and vect_optimize_slp_pass::forward_cost().

◆ impossible()

◆ is_better_than()

bool slpg_layout_cost::is_better_than ( const slpg_layout_cost & other,
bool is_for_size ) const
Return true if these costs are better than OTHER.  IS_FOR_SIZE is
true if we are optimizing for size rather than speed.   

References depth, ggc_alloc(), and total.

◆ is_possible()

◆ operator!=()

bool slpg_layout_cost::operator!= ( const slpg_layout_cost & other) const

References operator==().

◆ operator==()

bool slpg_layout_cost::operator== ( const slpg_layout_cost & other) const

References depth, and total.

Referenced by operator!=().

◆ split()

void slpg_layout_cost::split ( unsigned int times)
Split the total cost among TIMES successors or predecessors.   

References total.

Referenced by vect_optimize_slp_pass::backward_cost(), vect_optimize_slp_pass::edge_layout_cost(), and vect_optimize_slp_pass::forward_cost().

Field Documentation

◆ depth

sreal slpg_layout_cost::depth = 0

◆ total

sreal slpg_layout_cost::total = 0

The documentation for this struct was generated from the following file: