libFirm 1.20
libfirm/irextbb.h File Reference

Extended basis block support. More...

#include "firm_types.h"
#include "execfreq.h"
#include "begin.h"
#include "end.h"

Go to the source code of this file.

Typedefs

typedef void extbb_walk_func (ir_extblk *blk, void *env)
 The type of a walk function.

Functions

int is_ir_extbb (const void *thing)
 Checks whether a pointer points to a extended basic block.
void compute_extbb (ir_graph *irg)
 Compute the extended basic blocks for a graph.
void compute_extbb_execfreqs (ir_graph *irg, ir_exec_freq *execfreqs)
 Compute the extended basic blocks for a graph based on execution frequencies.
void free_extbb (ir_graph *irg)
 free all extended block info.
ir_extblkget_nodes_extbb (const ir_node *node)
 Returns the extended block of a node.
ir_visited_t get_extbb_visited (const ir_extblk *blk)
 Returns the visited counter of an extended block.
void set_extbb_visited (ir_extblk *blk, ir_visited_t visited)
 Sets the visited counter of an extended block.
void mark_extbb_visited (ir_extblk *blk)
 Mark an extended block as visited in a graph.
int extbb_visited (const ir_extblk *blk)
 Returns non-zero if an extended was visited.
int extbb_not_visited (const ir_extblk *blk)
 Returns non-zero if an extended block was NOT visited.
void * get_extbb_link (const ir_extblk *blk)
 Returns the link field of an extended block.
void set_extbb_link (ir_extblk *blk, void *link)
 Sets the link field of an extended block.
int get_extbb_n_blocks (const ir_extblk *blk)
 Returns the number of basic blocks of an extended block.
ir_nodeget_extbb_block (const ir_extblk *blk, int pos)
 Returns the i'th basic block of an extended block.
ir_nodeget_extbb_leader (const ir_extblk *blk)
 Returns the leader basic block of an extended block.
long get_extbb_node_nr (const ir_extblk *blk)
 Returns the node number of an extended block.
void irg_extblock_walk (ir_extblk *blk, extbb_walk_func *pre, extbb_walk_func *post, void *env)
 Walks only over Extended Basic Block nodes in the graph.
void irg_extblock_walk_graph (ir_graph *irg, extbb_walk_func *pre, extbb_walk_func *post, void *env)
 Walks only over reachable Extended Basic Block nodes in the graph.

Detailed Description

Extended basis block support.

Author:
Michael Beck
Date:
5.2005

Definition in file irextbb.h.


Typedef Documentation

typedef void extbb_walk_func(ir_extblk *blk, void *env)

The type of a walk function.

Does not use the link field.

Parameters:
blk- the extended basic block that is just visited
env- an environment pointer passed by the walk functions

Definition at line 42 of file irextbb.h.


Function Documentation

void compute_extbb ( ir_graph irg)

Compute the extended basic blocks for a graph.

void compute_extbb_execfreqs ( ir_graph irg,
ir_exec_freq execfreqs 
)

Compute the extended basic blocks for a graph based on execution frequencies.

int extbb_not_visited ( const ir_extblk blk)

Returns non-zero if an extended block was NOT visited.

Uses the block visit flag.

Parameters:
blkthe extended basic block
int extbb_visited ( const ir_extblk blk)

Returns non-zero if an extended was visited.

Uses the block visit flag.

Parameters:
blkthe extended basic block
void free_extbb ( ir_graph irg)

free all extended block info.

ir_node* get_extbb_block ( const ir_extblk blk,
int  pos 
)

Returns the i'th basic block of an extended block.

Parameters:
blkthe extended basic block
posthe position
ir_node* get_extbb_leader ( const ir_extblk blk)

Returns the leader basic block of an extended block.

Parameters:
blkthe extended basic block
void* get_extbb_link ( const ir_extblk blk)

Returns the link field of an extended block.

Parameters:
blkthe extended basic block
int get_extbb_n_blocks ( const ir_extblk blk)

Returns the number of basic blocks of an extended block.

Parameters:
blkthe extended basic block
long get_extbb_node_nr ( const ir_extblk blk)

Returns the node number of an extended block.

Its the block number of the leader block

Parameters:
blkthe extended basic block
ir_visited_t get_extbb_visited ( const ir_extblk blk)

Returns the visited counter of an extended block.

Parameters:
blkthe extended basic block
ir_extblk* get_nodes_extbb ( const ir_node node)

Returns the extended block of a node.

Parameters:
nodethe node
void irg_extblock_walk ( ir_extblk blk,
extbb_walk_func pre,
extbb_walk_func post,
void *  env 
)

Walks only over Extended Basic Block nodes in the graph.

Parameters:
blk- the start extended block node
pre- walker function, executed before the predecessor of a node are visited
post- walker function, executed after the predecessor of a node are visited
env- environment, passed to pre and post

This function Walks only over Block nodes in the graph. Has its own visited flag, so that it can be interleaved with the other walker. If a none block is passed, starts at the block this node belongs to. If end is passed also visits kept alive blocks. Does not use the link field.

void irg_extblock_walk_graph ( ir_graph irg,
extbb_walk_func pre,
extbb_walk_func post,
void *  env 
)

Walks only over reachable Extended Basic Block nodes in the graph.

Ensures, that the extended block containing the End node is visited last and the block containing Start visited first (in post order).

Parameters:
irg- the irg graph
pre- walker function, executed before the predecessor of a block are visited
post- walker function, executed after the predecessor of a block are visited
env- environment, passed to pre and post
int is_ir_extbb ( const void *  thing)

Checks whether a pointer points to a extended basic block.

Intern version for libFirm.

void mark_extbb_visited ( ir_extblk blk)

Mark an extended block as visited in a graph.

Uses the block visit flag.

Parameters:
blkthe extended basic block
void set_extbb_link ( ir_extblk blk,
void *  link 
)

Sets the link field of an extended block.

Parameters:
blkthe extended basic block
linkthe new link value
void set_extbb_visited ( ir_extblk blk,
ir_visited_t  visited 
)

Sets the visited counter of an extended block.

Parameters:
blkthe extended basic block
visitednew value for the visited counter