70 const DesignFlowManagerConstRef _design_flow_manager,
83 switch(relationship_type)
87 relationships.insert(std::make_pair(BLOCK_FIX,
SAME_FUNCTION));
88 relationships.insert(std::make_pair(SWITCH_FIX,
SAME_FUNCTION));
89 relationships.insert(std::make_pair(REBUILD_INITIALIZATION,
SAME_FUNCTION));
102 return relationships;
108 std::map<unsigned int, tree_nodeRef> var_substitution_table;
109 std::map<unsigned int, CustomOrderedSet<tree_nodeRef>> stmt_to_be_removed;
112 auto* fd = GetPointer<function_decl>(temp);
113 auto*
sl = GetPointer<statement_list>(
GET_NODE(fd->body));
114 const bool is_single_write_memory =
115 GetPointer<const HLS_manager>(
AppM) and GetPointer<const HLS_manager>(
AppM)->IsSingleWriteMemory();
117 for(
const auto&
block : sl->list_of_bloc)
119 const auto curr_bb =
block.first;
128 for(
const auto& stmt :
block.second->CGetStmtList())
132 auto* ga = GetPointer<gimple_assign>(tn);
133 if(!ga || !ga->clobber)
137 if(is_single_write_memory)
141 stmt_to_be_removed[curr_bb].insert(stmt);
145 if(is_single_write_memory)
148 for(
const auto&
block : sl->list_of_bloc)
150 const auto curr_bb =
block.first;
159 for(
const auto&
phi :
block.second->CGetPhiList())
164 for(
const auto& def_edge : gp->CGetDefEdgesList())
166 if(var_substitution_table.find(
GET_INDEX_NODE(def_edge.first)) != var_substitution_table.end())
169 while(var_substitution_table.find(
GET_INDEX_NODE(res)) != var_substitution_table.end())
174 !(GetPointer<ssa_name>(
GET_NODE(res)) &&
175 GetPointer<gimple_assign>(
GET_NODE(GetPointer<ssa_name>(
GET_NODE(res))->CGetDefStmt())) &&
176 GetPointer<gimple_assign>(
GET_NODE(GetPointer<ssa_name>(
GET_NODE(res))->CGetDefStmt()))
178 "unexpected condition");
179 gp->ReplaceDefEdge(TM, def_edge,
185 for(
const auto& stmt :
block.second->CGetStmtList())
189 auto* gn = GetPointer<gimple_node>(tn);
195 if(var_substitution_table.find(
GET_INDEX_NODE(gn->memuse)) != var_substitution_table.end())
205 const auto stbr_it_end = stmt_to_be_removed.end();
206 for(
auto stbr_it = stmt_to_be_removed.begin(); stbr_it != stbr_it_end; ++stbr_it)
208 unsigned int curr_bb = stbr_it->first;
209 for(
const auto& to_be_removed : stbr_it->second)
211 sl->list_of_bloc[curr_bb]->RemoveStmt(to_be_removed,
AppM);
#define GET_NODE(t)
Macro used to hide implementation details when accessing a tree_node from another tree_node...
Analysis step that removes clobber gimple_assign introduced by GCC v4.7 and greater.
Data structure representing the entire HLS information.
File containing functions and utilities to support the printing of debug messagges.
#define GET_CLASS(obj)
Macro returning the actual type of an object.
Definition of the class representing a generic C application.
RelationshipType
The relationship type.
Source must be executed to satisfy target.
remove_clobber_ga(const application_managerRef AppM, unsigned int function_id, const DesignFlowManagerConstRef design_flow_manager, const ParameterConstRef parameters)
Constructor.
const CustomUnorderedSet< std::pair< FrontendFlowStepType, FunctionRelationship > > ComputeFrontendRelationships(const DesignFlowStep::RelationshipType relationship_type) const override
Return the set of analyses in relationship with this design step.
static const unsigned int EXIT_BLOCK_ID
constant identifying the exit basic block
#define GET_INDEX_NODE(t)
Macro used to hide implementation details when accessing a tree_node from another tree_node...
Data structure describing a basic block at tree level.
Auxiliary methods for manipulating string.
const tree_nodeRef get_tree_node_const(unsigned int i) const
Return the reference to the i-th tree_node Constant version of get_tree_node.
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached
Target must be reexecuted.
std::pair< tree_nodeRef, unsigned int > DefEdge
The type of the def edge.
tree_nodeRef GetTreeReindex(const unsigned int i)
Return a tree_reindex wrapping the i-th tree_node.
Classes specification of the tree_node data structures.
DesignFlowStep_Status
The status of a step.
#define DEBUG_LEVEL_NONE
no debugging print is performed.
~remove_clobber_ga() override
Destructor.
This struct specifies the block node.
This file collects some utility functions.
const unsigned int function_id
The index of the function to be analyzed.
const application_managerRef AppM
The application manager.
Class specification of the tree_reindex support class.
static const unsigned int ENTRY_BLOCK_ID
constant identifying the entry basic block
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
this class is used to manage the command-line or XML options.
int debug_level
The debug level.
Class specification of the manager of the tree structures extracted from the raw file.
HLS specialization of generic_device.
A brief description of the C++ Header File.
DesignFlowStep_Status InternalExec() override
Updates the tree to have a more compliant CFG.
const FunctionBehaviorRef function_behavior
The function behavior of the function to be analyzed.
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...