PandA-2024.02
Public Types | Public Member Functions | Data Fields | Static Public Attributes | Private Member Functions | Private Attributes | Friends
bloc Struct Reference

This struct specifies the field bloc (basic block). More...

#include <tree_basic_block.hpp>

Collaboration diagram for bloc:
Collaboration graph
[legend]

Public Types

enum  { GETID =(list_of_phi) = 0 }
 visitor enum More...
 

Public Member Functions

 bloc (unsigned int _number)
 constructor More...
 
virtual ~bloc ()
 Destructor. More...
 
void add_pred (const unsigned int &a)
 Add a value to list of pred. More...
 
void add_succ (const unsigned int &a)
 Add a value to list of succ. More...
 
void AddPhi (const tree_nodeRef phi)
 Add a value to list of phi node. More...
 
void PushFront (const tree_nodeRef statement, const application_managerRef AppM)
 Add a statement in front of list of statements. More...
 
void PushBack (const tree_nodeRef statement, const application_managerRef AppM)
 Add a statement as last non controlling statement. More...
 
void Replace (const tree_nodeRef old_stmt, const tree_nodeRef new_stmt, const bool move_virtuals, const application_managerRef AppM)
 Replace a statement with another one. More...
 
void PushBefore (const tree_nodeRef new_stmt, const tree_nodeRef existing_stmt, const application_managerRef AppM)
 Add a statement before a specified one. More...
 
void PushAfter (const tree_nodeRef new_stmt, const tree_nodeRef existing_stmt, const application_managerRef AppM)
 Add a statement after a specified one. More...
 
void ReorderLUTs ()
 ReorderLUTs reorders the LUT statements to fix the def-use relations. More...
 
void RemoveStmt (const tree_nodeRef statement, const application_managerRef AppM)
 Remove a statement. More...
 
void RemovePhi (const tree_nodeRef phi)
 Remove a phi. More...
 
void SetSSAUsesComputed ()
 Set that uses of ssa have been computed. More...
 
const std::list< tree_nodeRef > & CGetPhiList () const
 Return the list of phi. More...
 
const std::list< tree_nodeRef > & CGetStmtList () const
 Return the list of stmt. More...
 
size_t CGetNumberRemovedPhi () const
 Return the number of removed phi. More...
 
virtual void visit (tree_node_visitor *const v) const
 virtual function used to traverse the tree_node data structure. More...
 

Data Fields

std::vector< unsigned int > list_of_pred
 list_of_pred is the list of predecessors. More...
 
std::vector< unsigned int > list_of_succ
 list_of_succ is the list of successors. More...
 
const unsigned int number
 number is the index of the basic block. More...
 
unsigned int loop_id
 loop identifier coming from GCC More...
 
CustomOrderedSet< unsigned int > live_in
 Live_In of the basic block. More...
 
CustomOrderedSet< unsigned int > live_out
 Live_Out of the basic block. More...
 
unsigned int hpl
 store the relation between the phi defs inserted in the live_out set and phi uses More...
 
unsigned int true_edge
 in case the last statement is a gimple_cond associated with an if statement this member contains the basic block reference to the then statements. More...
 
unsigned int false_edge
 in case the last statement is a gimple_cond associated with an if statement this member contains the basic block reference to the else statements. More...
 
ScheduleRef schedule
 The reference to the schedule. More...
 

Static Public Attributes

static const unsigned int ENTRY_BLOCK_ID = BB_ENTRY
 constant identifying the entry basic block More...
 
static const unsigned int EXIT_BLOCK_ID = BB_EXIT
 constant identifying the exit basic block More...
 

Private Member Functions

void update_new_stmt (const application_managerRef &AppM, const tree_nodeRef &new_stmt)
 
void manageCallGraph (const application_managerRef &AppM, const tree_nodeRef &statement)
 
bool check_function_call (const tree_nodeRef &statement, gimple_assign *ga, unsigned int &called_function_id)
 

Private Attributes

CustomUnorderedSet< unsigned int > already_visited
 Already visited tree node (used to avoid infinite recursion) More...
 
std::list< tree_nodeReflist_of_phi
 list_of_phi is a list of eventual phi node presents in the basic block. More...
 
std::list< tree_nodeReflist_of_stmt
 list_of_stmt is the list of statements stored in the basic block. More...
 
size_t removed_phi
 Number of removed phi. More...
 
bool updated_ssa_uses
 consistency of ssa uses More...
 

Friends

class use_counting
 

Detailed Description

This struct specifies the field bloc (basic block).

The tree walker structure of this node is: #(TOK_BLOC TOK_NUMBER (pred)+ (succ)+ (phi)* (stmt)*)

Definition at line 84 of file tree_basic_block.hpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

visitor enum

Enumerator
GETID 

Definition at line 262 of file tree_basic_block.hpp.

Constructor & Destructor Documentation

◆ bloc()

bloc::bloc ( unsigned int  _number)
explicit

constructor

Definition at line 62 of file tree_basic_block.cpp.

References ~bloc().

Here is the call graph for this function:

◆ ~bloc()

bloc::~bloc ( )
virtualdefault

Destructor.

Referenced by bloc().

Here is the caller graph for this function:

Member Function Documentation

◆ add_pred()

void bloc::add_pred ( const unsigned int &  a)
inline

Add a value to list of pred.

Parameters
ais a pred.

Definition at line 158 of file tree_basic_block.hpp.

◆ add_succ()

void bloc::add_succ ( const unsigned int &  a)
inline

Add a value to list of succ.

Parameters
ais a succ.

Definition at line 167 of file tree_basic_block.hpp.

References AddPhi(), FrontendFlowStep::AppM, CGetNumberRemovedPhi(), CGetPhiList(), CGetStmtList(), phi, PushAfter(), PushBack(), PushBefore(), PushFront(), RemovePhi(), RemoveStmt(), ReorderLUTs(), Replace(), and SetSSAUsesComputed().

Here is the call graph for this function:

◆ AddPhi()

void bloc::AddPhi ( const tree_nodeRef  phi)

Add a value to list of phi node.

Parameters
ais a NODE_ID.

Definition at line 500 of file tree_basic_block.cpp.

References list_of_phi, and update_new_stmt().

Referenced by add_succ().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CGetNumberRemovedPhi()

size_t bloc::CGetNumberRemovedPhi ( ) const

Return the number of removed phi.

Definition at line 536 of file tree_basic_block.cpp.

References removed_phi.

Referenced by add_succ().

Here is the caller graph for this function:

◆ CGetPhiList()

const std::list< tree_nodeRef > & bloc::CGetPhiList ( ) const

Return the list of phi.

Definition at line 495 of file tree_basic_block.cpp.

References list_of_phi.

Referenced by add_succ(), and raw_writer::write_when_not_null_point_to().

Here is the caller graph for this function:

◆ CGetStmtList()

const std::list< tree_nodeRef > & bloc::CGetStmtList ( ) const

Return the list of stmt.

Definition at line 282 of file tree_basic_block.cpp.

References list_of_stmt.

Referenced by add_succ(), and raw_writer::write_when_not_null_point_to().

Here is the caller graph for this function:

◆ check_function_call()

bool bloc::check_function_call ( const tree_nodeRef statement,
gimple_assign ga,
unsigned int &  called_function_id 
)
private

Definition at line 78 of file tree_basic_block.cpp.

References GET_CONST_NODE, GET_INDEX_CONST_NODE, GET_INDEX_NODE, GET_NODE, and gimple_assign::op1.

Referenced by manageCallGraph(), and RemoveStmt().

Here is the caller graph for this function:

◆ manageCallGraph()

void bloc::manageCallGraph ( const application_managerRef AppM,
const tree_nodeRef statement 
)
private

Definition at line 199 of file tree_basic_block.cpp.

References CallGraphManager::addCallPointAndExpand(), already_visited, check_function_call(), FunctionEdgeInfo::direct_call, GET_INDEX_CONST_NODE, GET_INDEX_NODE, GET_NODE, THROW_ASSERT, and tree_node::ToString().

Referenced by update_new_stmt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PushAfter()

void bloc::PushAfter ( const tree_nodeRef  new_stmt,
const tree_nodeRef  existing_stmt,
const application_managerRef  AppM 
)

Add a statement after a specified one.

Parameters
new_stmtis the statement to be added
existing_stmtis the statement after which new_stmt has to be added

Definition at line 306 of file tree_basic_block.cpp.

References ENTRY_BLOCK_ID, GET_NODE, tree_node::index, list_of_stmt, number, THROW_ASSERT, tree_node::ToString(), and update_new_stmt().

Referenced by add_succ().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PushBack()

void bloc::PushBack ( const tree_nodeRef  statement,
const application_managerRef  AppM 
)

Add a statement as last non controlling statement.

Parameters
statementis the statement to be added

Definition at line 340 of file tree_basic_block.cpp.

References GET_NODE, tree_helper::LastStatement(), list_of_stmt, number, THROW_ASSERT, tree_node::ToString(), and update_new_stmt().

Referenced by add_succ(), and Replace().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PushBefore()

void bloc::PushBefore ( const tree_nodeRef  new_stmt,
const tree_nodeRef  existing_stmt,
const application_managerRef  AppM 
)

Add a statement before a specified one.

Parameters
new_stmtis the statement to be added
existing_stmtis the statement before which new_stmt has to be added

Definition at line 287 of file tree_basic_block.cpp.

References ENTRY_BLOCK_ID, GET_NODE, tree_node::index, list_of_stmt, number, STR, THROW_ASSERT, tree_node::ToString(), and update_new_stmt().

Referenced by add_succ(), and Replace().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PushFront()

void bloc::PushFront ( const tree_nodeRef  statement,
const application_managerRef  AppM 
)

Add a statement in front of list of statements.

Parameters
statementis the statement to be added

Definition at line 325 of file tree_basic_block.cpp.

References GET_NODE, list_of_stmt, THROW_ASSERT, tree_node::ToString(), and update_new_stmt().

Referenced by add_succ().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RemovePhi()

void bloc::RemovePhi ( const tree_nodeRef  phi)

Remove a phi.

Parameters
phiis the phi to be removed

Definition at line 506 of file tree_basic_block.cpp.

References tree_helper::ComputeSsaUses(), counter, GET_NODE, tree_node::index, list_of_phi, removed_phi, THROW_ASSERT, tree_node::ToString(), and updated_ssa_uses.

Referenced by add_succ().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RemoveStmt()

void bloc::RemoveStmt ( const tree_nodeRef  statement,
const application_managerRef  AppM 
)

Remove a statement.

Parameters
statementis the statement to be removed

Definition at line 424 of file tree_basic_block.cpp.

References BUILTIN_WAIT_CALL, check_function_call(), tree_helper::ComputeSsaUses(), counter, GET_INDEX_NODE, GET_NODE, tree_node::index, list_of_stmt, number, tree_helper::print_function_name(), STR, THROW_ASSERT, tree_node::ToString(), and updated_ssa_uses.

Referenced by add_succ(), and Replace().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReorderLUTs()

void bloc::ReorderLUTs ( )

ReorderLUTs reorders the LUT statements to fix the def-use relations.

add back

Definition at line 110 of file tree_basic_block.cpp.

References tree_helper::ComputeSsaUses(), GET_NODE, list_of_phi, list_of_stmt, number, phi, schedule, and Schedule::UpdateTime().

Referenced by add_succ().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Replace()

void bloc::Replace ( const tree_nodeRef  old_stmt,
const tree_nodeRef  new_stmt,
const bool  move_virtuals,
const application_managerRef  AppM 
)

Replace a statement with another one.

Parameters
old_stmtis the old statement to be removed
new_stmtis the new statement to be added
move_virtualsspecifies if memdef and vdef have to be transferred

Definition at line 364 of file tree_basic_block.cpp.

References GET_NODE, tree_node::index, list_of_stmt, PushBack(), PushBefore(), RemoveStmt(), STR, and THROW_ASSERT.

Referenced by add_succ().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetSSAUsesComputed()

void bloc::SetSSAUsesComputed ( )

Set that uses of ssa have been computed.

Definition at line 541 of file tree_basic_block.cpp.

References THROW_ASSERT, and updated_ssa_uses.

Referenced by add_succ().

Here is the caller graph for this function:

◆ update_new_stmt()

void bloc::update_new_stmt ( const application_managerRef AppM,
const tree_nodeRef new_stmt 
)
private

This check is necessary since during parsing of statement list statement has not yet been filled

Definition at line 222 of file tree_basic_block.cpp.

References tree_helper::ComputeSsaUses(), counter, GET_NODE, tree_node::index, manageCallGraph(), number, schedule, THROW_ASSERT, updated_ssa_uses, and Schedule::UpdateTime().

Referenced by AddPhi(), PushAfter(), PushBack(), PushBefore(), and PushFront().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ visit()

void bloc::visit ( tree_node_visitor *const  v) const
virtual

virtual function used to traverse the tree_node data structure.

Parameters
vis a reference to the tree_node visitor class

live in and out not visited by design

Definition at line 69 of file tree_basic_block.cpp.

References ALL_VISIT, list_of_phi, list_of_stmt, and SEQ_VISIT_MEMBER.

Friends And Related Function Documentation

◆ use_counting

friend class use_counting
friend

Definition at line 87 of file tree_basic_block.hpp.

Field Documentation

◆ already_visited

CustomUnorderedSet<unsigned int> bloc::already_visited
private

Already visited tree node (used to avoid infinite recursion)

Definition at line 90 of file tree_basic_block.hpp.

Referenced by manageCallGraph().

◆ ENTRY_BLOCK_ID

const unsigned int bloc::ENTRY_BLOCK_ID = BB_ENTRY
static

◆ EXIT_BLOCK_ID

const unsigned int bloc::EXIT_BLOCK_ID = BB_EXIT
static

◆ false_edge

unsigned int bloc::false_edge

in case the last statement is a gimple_cond associated with an if statement this member contains the basic block reference to the else statements.

Definition at line 139 of file tree_basic_block.hpp.

Referenced by raw_writer::write_when_not_null_point_to().

◆ hpl

unsigned int bloc::hpl

store the relation between the phi defs inserted in the live_out set and phi uses

flag for header of reducible parallelizable loop

Definition at line 131 of file tree_basic_block.hpp.

Referenced by raw_writer::write_when_not_null_point_to().

◆ list_of_phi

std::list<tree_nodeRef> bloc::list_of_phi
private

list_of_phi is a list of eventual phi node presents in the basic block.

Definition at line 93 of file tree_basic_block.hpp.

Referenced by AddPhi(), CGetPhiList(), RemovePhi(), ReorderLUTs(), and visit().

◆ list_of_pred

std::vector<unsigned int> bloc::list_of_pred

list_of_pred is the list of predecessors.

Definition at line 110 of file tree_basic_block.hpp.

Referenced by raw_writer::write_when_not_null_point_to().

◆ list_of_stmt

std::list<tree_nodeRef> bloc::list_of_stmt
private

list_of_stmt is the list of statements stored in the basic block.

Definition at line 96 of file tree_basic_block.hpp.

Referenced by CGetStmtList(), PushAfter(), PushBack(), PushBefore(), PushFront(), RemoveStmt(), ReorderLUTs(), Replace(), and visit().

◆ list_of_succ

std::vector<unsigned int> bloc::list_of_succ

list_of_succ is the list of successors.

Definition at line 113 of file tree_basic_block.hpp.

Referenced by raw_writer::write_when_not_null_point_to().

◆ live_in

CustomOrderedSet<unsigned int> bloc::live_in

Live_In of the basic block.

Definition at line 122 of file tree_basic_block.hpp.

◆ live_out

CustomOrderedSet<unsigned int> bloc::live_out

Live_Out of the basic block.

Definition at line 125 of file tree_basic_block.hpp.

◆ loop_id

unsigned int bloc::loop_id

loop identifier coming from GCC

Definition at line 119 of file tree_basic_block.hpp.

Referenced by raw_writer::write_when_not_null_point_to().

◆ number

const unsigned int bloc::number

number is the index of the basic block.

Definition at line 116 of file tree_basic_block.hpp.

Referenced by PushAfter(), PushBack(), PushBefore(), RemoveStmt(), ReorderLUTs(), update_new_stmt(), and raw_writer::write_when_not_null_point_to().

◆ removed_phi

size_t bloc::removed_phi
private

Number of removed phi.

Definition at line 99 of file tree_basic_block.hpp.

Referenced by CGetNumberRemovedPhi(), and RemovePhi().

◆ schedule

ScheduleRef bloc::schedule

The reference to the schedule.

Definition at line 142 of file tree_basic_block.hpp.

Referenced by ReorderLUTs(), and update_new_stmt().

◆ true_edge

unsigned int bloc::true_edge

in case the last statement is a gimple_cond associated with an if statement this member contains the basic block reference to the then statements.

Definition at line 135 of file tree_basic_block.hpp.

Referenced by raw_writer::write_when_not_null_point_to().

◆ updated_ssa_uses

bool bloc::updated_ssa_uses
private

consistency of ssa uses

Definition at line 102 of file tree_basic_block.hpp.

Referenced by RemovePhi(), RemoveStmt(), SetSSAUsesComputed(), and update_new_stmt().


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

Generated on Mon Feb 12 2024 13:03:46 for PandA-2024.02 by doxygen 1.8.13