PandA-2024.02
commutative_expr_restructuring.cpp
Go to the documentation of this file.
1 /*
2  *
3  * _/_/_/ _/_/ _/ _/ _/_/_/ _/_/
4  * _/ _/ _/ _/ _/_/ _/ _/ _/ _/ _/
5  * _/_/_/ _/_/_/_/ _/ _/_/ _/ _/ _/_/_/_/
6  * _/ _/ _/ _/ _/ _/ _/ _/ _/
7  * _/ _/ _/ _/ _/ _/_/_/ _/ _/
8  *
9  * ***********************************************
10  * PandA Project
11  * URL: http://panda.dei.polimi.it
12  * Politecnico di Milano - DEIB
13  * System Architectures Group
14  * ***********************************************
15  * Copyright (C) 2018-2024 Politecnico di Milano
16  *
17  * This file is part of the PandA framework.
18  *
19  * The PandA framework is free software; you can redistribute it and/or modify
20  * it under the terms of the GNU General Public License as published by
21  * the Free Software Foundation; either version 3 of the License, or
22  * (at your option) any later version.
23  *
24  * This program is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27  * GNU General Public License for more details.
28  *
29  * You should have received a copy of the GNU General Public License
30  * along with this program. If not, see <http://www.gnu.org/licenses/>.
31  *
32  */
43 
45 #include "Parameter.hpp"
46 
48 #include "application_manager.hpp"
49 
51 #include "design_flow_graph.hpp"
52 #include "design_flow_manager.hpp"
53 
55 #include "hls.hpp"
56 #include "hls_manager.hpp"
57 #include "hls_step.hpp"
58 
60 #include "fu_binding.hpp"
61 
64 
66 #include "schedule.hpp"
67 
69 #include "token_interface.hpp"
70 
72 #include "dbgPrintHelper.hpp" // for DEBUG_LEVEL_
73 #include "string_manipulation.hpp" // for GET_CLASS
74 #include "tree_basic_block.hpp"
75 #include "tree_helper.hpp"
76 #include "tree_manager.hpp"
77 #include "tree_manipulation.hpp"
78 #include "tree_node.hpp"
79 #include "tree_reindex.hpp"
80 
81 #define EPSILON 0.0001
82 
85  const DesignFlowStep::RelationshipType relationship_type) const
86 {
88  switch(relationship_type)
89  {
91  {
92  break;
93  }
95  {
98  {
99  if(parameters->getOption<HLSFlowStep_Type>(OPT_scheduling_algorithm) == HLSFlowStep_Type::SDC_SCHEDULING &&
100  GetPointer<const HLS_manager>(AppM) && GetPointer<const HLS_manager>(AppM)->get_HLS(function_id) and
101  GetPointer<const HLS_manager>(AppM)->get_HLS(function_id)->Rsch)
102  {
104  const auto update_schedule = design_flow_manager.lock()->GetDesignFlowStep(
105  FunctionFrontendFlowStep::ComputeSignature(FrontendFlowStepType::UPDATE_SCHEDULE, function_id));
106  if(update_schedule)
107  {
108  const DesignFlowGraphConstRef design_flow_graph = design_flow_manager.lock()->CGetDesignFlowGraph();
109  const DesignFlowStepRef design_flow_step =
110  design_flow_graph->CGetDesignFlowStepInfo(update_schedule)->design_flow_step;
111  if(GetPointer<const FunctionFrontendFlowStep>(design_flow_step)->CGetBBVersion() !=
112  function_behavior->GetBBVersion())
113  {
114  relationships.insert(std::make_pair(UPDATE_SCHEDULE, SAME_FUNCTION));
115  break;
116  }
117  }
118  }
119  }
120  break;
121  }
123  {
124  relationships.insert(std::make_pair(COMPLETE_BB_GRAPH, SAME_FUNCTION));
125  relationships.insert(std::make_pair(FUNCTION_CALL_OPT, SAME_FUNCTION));
126  relationships.insert(std::make_pair(MULTI_WAY_IF, SAME_FUNCTION));
127  relationships.insert(std::make_pair(SHORT_CIRCUIT_TAF, SAME_FUNCTION));
128  break;
129  }
130  default:
131  {
132  THROW_UNREACHABLE("");
133  }
134  }
135  return relationships;
136 }
137 
139  unsigned int _function_id,
140  const DesignFlowManagerConstRef _design_flow_manager,
141  const ParameterConstRef _parameters)
142  : FunctionFrontendFlowStep(_AppM, _function_id, COMMUTATIVE_EXPR_RESTRUCTURING, _design_flow_manager, _parameters)
143 {
144  debug_level = parameters->get_class_debug_level(GET_CLASS(*this), DEBUG_LEVEL_NONE);
145 }
146 
148 
150 {
151  const auto ga = GetPointer<const gimple_assign>(GET_CONST_NODE(tn));
152  if(!ga)
153  {
154  return false;
155  }
156  auto opKind = GET_NODE(ga->op1)->get_kind();
157  auto Type = tree_helper::CGetType(ga->op0);
158  if(!GetPointer<const integer_type>(GET_CONST_NODE(Type)))
159  {
160  return false;
161  }
162  return opKind == mult_expr_K || opKind == widen_mult_expr_K || opKind == widen_sum_expr_K ||
163  opKind == bit_ior_expr_K || opKind == bit_xor_expr_K || opKind == bit_and_expr_K || opKind == eq_expr_K ||
164  opKind == ne_expr_K || opKind == plus_expr_K;
165 }
166 
168  bool is_third_node) const
169 {
170  const auto ga = GetPointer<const gimple_assign>(GET_CONST_NODE(tn));
171  const auto be = GetPointer<const binary_expr>(GET_NODE(ga->op1));
172  const auto operand = first ? GET_NODE(be->op0) : GET_NODE(be->op1);
173  const auto other_operand = first ? GET_NODE(be->op1) : GET_NODE(be->op0);
174  const auto sn = GetPointer<const ssa_name>(operand);
175  if(tree_helper::is_constant(TM, other_operand->index))
176  {
177  return tree_nodeRef();
178  }
179  if(!sn)
180  {
181  return tree_nodeRef();
182  }
183  if(!is_third_node && sn->CGetNumberUses() > 1)
184  {
185  return tree_nodeRef();
186  }
187  const auto def = GetPointer<const gimple_assign>(GET_NODE(sn->CGetDefStmt()));
188  if(!def)
189  {
190  return tree_nodeRef();
191  }
192  if(def->bb_index != ga->bb_index)
193  {
194  return tree_nodeRef();
195  }
196  if(GET_NODE(def->op1)->get_kind() != GET_NODE(ga->op1)->get_kind())
197  {
198  return tree_nodeRef();
199  }
200  if(schedule->GetStartingTime(ga->index) == schedule->GetEndingTime(def->index) or
201  (schedule->get_cstep_end(def->index).second + 1) == schedule->get_cstep(ga->index).second)
202  {
203  return sn->CGetDefStmt();
204  }
205  else
206  {
207  return tree_nodeRef();
208  }
209 }
210 
212 {
213  bool modified = false;
214  static size_t counter = 0;
215 
217  auto* fd = GetPointer<function_decl>(TM->get_tree_node_const(function_id));
218  auto* sl = GetPointer<statement_list>(GET_NODE(fd->body));
219  for(const auto& block : sl->list_of_bloc)
220  {
221  INDENT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "-->Examining BB" + STR(block.first));
222  const auto& list_of_stmt = block.second->CGetStmtList();
223  for(auto stmt = list_of_stmt.begin(); stmt != list_of_stmt.end(); stmt++)
224  {
225  if(!AppM->ApplyNewTransformation())
226  {
227  break;
228  }
229 
230  std::list<tree_nodeRef> new_tree_nodes;
231 
232  INDENT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "-->Examining " + (*stmt)->ToString());
233  auto next_stmt_ptr = std::next(stmt);
234  tree_nodeRef next_stmt = std::next(stmt) != list_of_stmt.end() ? *(std::next(stmt)) : tree_nodeRef();
235  tree_nodeRef first_stmt = *stmt;
236  tree_nodeRef second_stmt = tree_nodeRef();
237  tree_nodeRef third_stmt = tree_nodeRef();
238  if(!IsCommExprGimple(*stmt))
239  {
240  INDENT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "<--Not a commutative_expr");
241  continue;
242  }
243  bool first_operand_of_first = true;
244  bool first_operand_of_second = true;
245  second_stmt = IsCommExprChain(*stmt, true, false);
246  if(!second_stmt)
247  {
248  second_stmt = IsCommExprChain(*stmt, false, false);
249  first_operand_of_first = false;
250  }
251  if(second_stmt)
252  {
254  "---Chained with a second commutative expression: " + STR(second_stmt));
255  third_stmt = IsCommExprChain(second_stmt, true, true);
256  if(!third_stmt)
257  {
258  third_stmt = IsCommExprChain(second_stmt, false, true);
259  first_operand_of_second = false;
260  }
261  }
262  if(!third_stmt)
263  {
264  INDENT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "<--Not chained with two commutative expression");
265  continue;
266  }
267  const auto first_ga = GetPointer<const gimple_assign>(GET_NODE(*stmt));
268  auto comm_expr_kind = GET_NODE(first_ga->op1)->get_kind();
269  auto comm_expr_kind_text = GET_NODE(first_ga->op1)->get_kind_text();
270  const auto first_be = GetPointer<const binary_expr>(GET_NODE(first_ga->op1));
271 
272  const auto second_ga = GetPointer<const gimple_assign>(GET_NODE(second_stmt));
273  THROW_ASSERT(GET_NODE(second_ga->op1)->get_kind() == comm_expr_kind, "unexpected condition");
274  const auto second_be = GetPointer<const binary_expr>(GET_NODE(second_ga->op1));
275 
276  const auto third_ga = GetPointer<const gimple_assign>(GET_NODE(third_stmt));
277  THROW_ASSERT(GET_NODE(third_ga->op1)->get_kind() == comm_expr_kind, "unexpected condition");
278  const auto third_be = GetPointer<const binary_expr>(GET_NODE(third_ga->op1));
279 
280  const double old_time = schedule->GetEndingTime(first_ga->index);
281 
284  double operand_ready_time = 0.0;
285 
286  const auto other_operand_of_first = first_operand_of_first ? first_be->op1 : first_be->op0;
287  const auto other_operand_of_second = first_operand_of_second ? second_be->op1 : second_be->op0;
289  operands.insert(std::make_pair(other_operand_of_first, *stmt));
290  operands.insert(std::make_pair(other_operand_of_second, second_stmt));
291  operands.insert(std::make_pair(third_be->op0, third_stmt));
292  operands.insert(std::make_pair(third_be->op1, third_stmt));
293  for(const auto& operand : operands)
294  {
296  "---Analyzing when " + STR(operand.first) + " used in " + STR(operand.second) + " is ready");
297  const auto sn = GetPointer<const ssa_name>(GET_NODE(operand.first));
298  if(sn)
299  {
300  const auto def_operand = GetPointer<const gimple_node>(GET_NODE(sn->CGetDefStmt()));
301  if(def_operand->bb_index == block.first)
302  {
303  const auto def_stmt = sn->CGetDefStmt();
304  const auto ending_time = schedule->GetEndingTime(def_stmt->index);
305  INDENT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "---Ending time is " + STR(ending_time));
306  const auto connection_time = allocation_information->GetConnectionTime(
307  def_stmt->index, operand.second->index, schedule->get_cstep(def_stmt->index));
309  "---Connection time is " + STR(connection_time));
310  const auto current_operand_ready_time = ending_time + connection_time;
311  operand_ready_time = std::max(operand_ready_time, current_operand_ready_time);
313  "---New ready time is " + STR(operand_ready_time));
314  }
315  }
316  }
317 
318  const auto comm_expr_time1 = allocation_information->GetTimeLatency((*stmt)->index, fu_binding::UNKNOWN).first;
320  "---Delay of first operation is " + STR(comm_expr_time1));
321  const auto comm_expr_time2 =
324  "---Delay of second operation is " + STR(comm_expr_time2));
325  const auto comm_expr_time3 =
328  "---Delay of third operation is " + STR(comm_expr_time3));
329  const auto new_ending_time = operand_ready_time + std::max(comm_expr_time1, comm_expr_time3) +
330  comm_expr_time2 +
331  allocation_information->GetConnectionTime(third_ga->index, second_ga->index,
332  schedule->get_cstep(third_ga->index));
334  "---Operand ready time " + STR(operand_ready_time) + " - New ending time " +
335  STR(new_ending_time) + " - Old ending time " + STR(old_time));
336  if(new_ending_time + EPSILON >= old_time)
337  {
338  INDENT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "<--Increased execution time");
339  continue;
340  }
341  INDENT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "---Chained with a third commutative expression");
342  THROW_ASSERT(third_stmt && second_stmt, "");
346 
348  const auto type_node = tree_helper::CGetType(*stmt);
349  auto first_value = first_operand_of_second ? second_be->op1 : second_be->op0;
350  auto second_value = first_operand_of_first ? first_be->op1 : first_be->op0;
351  if(!first_operand_of_first)
352  {
353  std::swap(first_value, second_value);
354  }
355  const auto comm_expr_node =
356  tree_man->create_binary_operation(type_node, first_value, second_value, BUILTIN_SRCP, comm_expr_kind);
357 
359  tree_nodeRef var = nullptr;
360  if(GET_NODE(first_value)->get_kind() == ssa_name_K && GET_NODE(second_value)->get_kind() == ssa_name_K)
361  {
362  const auto sn1 = GetPointer<const ssa_name>(GET_NODE(first_value));
363  const auto sn2 = GetPointer<const ssa_name>(GET_NODE(second_value));
364  if(sn1->var && sn2->var && sn1->var->index == sn2->var->index)
365  {
366  var = sn1->var;
367  }
368  }
369  const auto first_ga_op0 = GetPointer<ssa_name>(GET_NODE(first_ga->op0));
370  const auto ssa_node = tree_man->create_ssa_name(var, type_node, first_ga_op0->min, first_ga_op0->max);
371  GetPointer<ssa_name>(GET_CONST_NODE(ssa_node))->bit_values = first_ga_op0->bit_values;
372 
374  const auto gimple_assign_node =
375  tree_man->create_gimple_modify_stmt(ssa_node, comm_expr_node, function_id, BUILTIN_SRCP);
377  "---Created " + GET_CONST_NODE(gimple_assign_node)->ToString());
379  block.second->PushBefore(gimple_assign_node, *stmt, AppM);
380  new_tree_nodes.push_back(gimple_assign_node);
381 
383  const auto root_comm_expr =
384  tree_man->create_binary_operation(type_node, first_operand_of_second ? second_be->op0 : second_be->op1,
385  ssa_node, BUILTIN_SRCP, comm_expr_kind);
386 
388  const auto root_gimple_node =
389  tree_man->create_gimple_modify_stmt(first_ga->op0, root_comm_expr, function_id, BUILTIN_SRCP);
391  "---Created " + GET_CONST_NODE(root_gimple_node)->ToString());
392  block.second->Replace(*stmt, root_gimple_node, true, AppM);
393  new_tree_nodes.push_back(root_gimple_node);
394  AppM->RegisterTransformation(GetName(), root_gimple_node);
395 
397  THROW_ASSERT(GetPointer<const ssa_name>(GET_CONST_NODE(second_ga->op0))->CGetUseStmts().size() == 0, "");
398 
400  block.second->RemoveStmt(second_stmt, AppM);
401 
402  for(const auto& temp_stmt : list_of_stmt)
403  {
404  schedule->UpdateTime(temp_stmt->index);
405  }
406 
408  (!parameters->IsParameter("print-dot-FF") || parameters->GetParameter<unsigned int>("print-dot-FF")))
409  {
410  WriteBBGraphDot("BB_Inside_" + GetName() + "_" + STR(counter) + ".dot");
412  "---Written BB_Inside_" + GetName() + "_" + STR(counter) + ".dot");
413  counter++;
414  }
415  const double new_time = schedule->GetEndingTime(GET_INDEX_CONST_NODE(root_gimple_node));
416  if(new_time + EPSILON > old_time)
417  {
418  INDENT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "<--Error in estimation");
420  for(const auto& to_be_removed : new_tree_nodes)
421  {
422  block.second->RemoveStmt(to_be_removed, AppM);
423  }
424 
426  next_stmt ? block.second->PushBefore(second_stmt, next_stmt, AppM) :
427  block.second->PushBack(second_stmt, AppM);
428  next_stmt ? block.second->PushBefore(first_stmt, next_stmt, AppM) :
429  block.second->PushBack(first_stmt, AppM);
430 
432  for(const auto& temp_stmt : list_of_stmt)
433  {
434  schedule->UpdateTime(temp_stmt->index);
435  }
436 
438  stmt = std::prev(next_stmt_ptr);
439  continue;
440  }
442  "-->Commutative expression restructuring applied on three " + comm_expr_kind_text +
443  " operations");
446  modified = true;
447  INDENT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "<--Examined statement");
448  stmt = list_of_stmt.begin();
449  }
450  INDENT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "<--Examined BB" + STR(block.first));
451  }
452 
453  if(modified)
454  {
455  function_behavior->UpdateBBVersion();
456  }
458 }
459 
461 {
463  TM = AppM->get_tree_manager();
464  if(GetPointer<HLS_manager>(AppM) && GetPointer<HLS_manager>(AppM)->get_HLS(function_id))
465  {
466  schedule = GetPointer<HLS_manager>(AppM)->get_HLS(function_id)->Rsch;
467  allocation_information = GetPointer<HLS_manager>(AppM)->get_HLS(function_id)->allocation_information;
468  }
469 }
470 
472 {
474  {
475  return false;
476  }
477 #if HAVE_ILP_BUILT
478  if(parameters->getOption<HLSFlowStep_Type>(OPT_scheduling_algorithm) == HLSFlowStep_Type::SDC_SCHEDULING &&
479  GetPointer<const HLS_manager>(AppM) && GetPointer<const HLS_manager>(AppM)->get_HLS(function_id) and
480  GetPointer<const HLS_manager>(AppM)->get_HLS(function_id)->Rsch)
481  {
483  const auto update_schedule = design_flow_manager.lock()->GetDesignFlowStep(
484  FunctionFrontendFlowStep::ComputeSignature(FrontendFlowStepType::UPDATE_SCHEDULE, function_id));
485  if(update_schedule)
486  {
487  const DesignFlowGraphConstRef design_flow_graph = design_flow_manager.lock()->CGetDesignFlowGraph();
488  const DesignFlowStepRef design_flow_step =
489  design_flow_graph->CGetDesignFlowStepInfo(update_schedule)->design_flow_step;
490  if(GetPointer<const FunctionFrontendFlowStep>(design_flow_step)->CGetBBVersion() !=
491  function_behavior->GetBBVersion())
492  {
493  return false;
494  }
495  else
496  {
497  return true;
498  }
499  }
500  else
501  {
502  return false;
503  }
504  }
505  else
506 #endif
507  {
508  return false;
509  }
510 }
#define GET_NODE(t)
Macro used to hide implementation details when accessing a tree_node from another tree_node...
Definition: tree_node.hpp:343
#define DEBUG_LEVEL_VERY_PEDANTIC
extremely verbose debugging print is performed.
Data structure representing the entire HLS information.
#define INDENT_DBG_MEX(dbgLevel, curDbgLevel, mex)
We are producing a debug version of the program, so the message is printed;.
virtual void Initialize()
Initialize the step (i.e., like a constructor, but executed just before exec.
File containing functions and utilities to support the printing of debug messagges.
bool IsCommExprGimple(const tree_nodeConstRef tn) const
Return true if tree node is a gimple_assign with a mult_expr/plus_expr in the right part...
Step successfully executed.
#define GET_CLASS(obj)
Macro returning the actual type of an object.
Definition of the class representing a generic C application.
const int output_level
The output level.
std::string GetName() const override
Return the name of this design step.
RelationshipType
The relationship type.
DesignFlowStep_Status InternalExec() override
Performs the loops analysis.
bool HasToBeExecuted() const override
Check if this step has actually to be executed.
Source must be executed to satisfy target.
AbsControlStep get_cstep(const vertex &op) const
Returns the clock cycle where the given operation has been scheduled.
Definition: schedule.cpp:270
#define INDENT_OUT_MEX(outLevel, curOutLevel, mex)
AbsControlStep get_cstep_end(const vertex &op) const
Return the last clock cycle in which the operation execute.
Definition: schedule.cpp:302
tree_nodeRef create_binary_operation(const tree_nodeConstRef &type, const tree_nodeRef &op0, const tree_nodeRef &op1, const std::string &srcp, enum kind operation_kind) const
Function used to create a binary expression.
A simple interface to token object of the raw files.
Data structure describing a basic block at tree level.
std::pair< double, double > GetTimeLatency(const unsigned int operation, const unsigned int functional_unit, const unsigned int stage=0) const
Return the execution time of (a stage of) an operation.
#define STR(s)
Macro which performs a lexical_cast to a string.
Auxiliary methods for manipulating string.
bool HasToBeExecuted() const override
Check if this step has actually to be executed.
#define max
Definition: backprop.h:17
#define EPSILON
Header include.
std::string ToString(ActorGraphBackend_Type actor_graph_backend_type)
Header include.
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
Definition: exceptions.hpp:292
tree_managerRef TM
The tree manager.
void UpdateTime(const unsigned int operation_index, bool update_cs=true)
Compute the starting and the ending time of a statement.
Definition: schedule.cpp:337
Data structure used to store the schedule of the operations.
HLSFlowStep_Type
Definition: hls_step.hpp:95
~commutative_expr_restructuring() override
Destructor.
void WriteBBGraphDot(const std::string &filename) const
Write the current version of statement list in dot format.
const unsigned int index
Represent the index read from the raw file and the index-1 of the vector of tree_node associated to t...
Definition: tree_node.hpp:146
Classes to describe design flow graph.
const Wrefcount< const DesignFlowManager > design_flow_manager
The design flow manager.
#define GET_CONST_NODE(t)
Definition: tree_node.hpp:347
DesignFlowStep_Status GetStatus() const
Return the status of this design step.
Classes specification of the tree_node data structures.
const ParameterConstRef parameters
Set of input parameters.
DesignFlowStep_Status
The status of a step.
This package is used by all HLS packages to manage resource constraints and characteristics.
Class defining some useful functions to create tree nodes and to manipulate the tree manager...
#define DEBUG_LEVEL_NONE
no debugging print is performed.
Wrapper of design_flow.
static const unsigned int UNKNOWN
The value used to identified unknown functional unit.
Definition: fu_binding.hpp:178
void Initialize() override
Initialize the step (i.e., like a constructor, but executed just before exec.
This struct specifies the block node.
Definition: tree_node.hpp:1820
This file collects some utility functions.
tree_nodeRef IsCommExprChain(const tree_nodeConstRef tn, const bool first, bool is_third_node) const
Given a gimple_assign with a commutative operation it checks:
double GetStartingTime(const unsigned int operation) const
Return the starting time of the operation.
Definition: schedule.cpp:1151
refcount< T > lock() const
Definition: refcount.hpp:212
#define BUILTIN_SRCP
const unsigned int function_id
The index of the function to be analyzed.
const application_managerRef AppM
The application manager.
struct definition of the type node structures.
Definition: tree_node.hpp:1318
Class specification of the tree_reindex support class.
Data structure used to store the functional-unit binding of the vertexes.
AllocationInformationRef allocation_information
The allocation information.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
Definition: refcount.hpp:94
static tree_nodeConstRef CGetType(const tree_nodeConstRef &node)
Return the treenode of the type of node.
commutative_expr_restructuring(const application_managerRef AppM, unsigned int function_id, const DesignFlowManagerConstRef design_flow_manager, const ParameterConstRef parameters)
Constructor.
refcount< const tree_manipulation > tree_manipulationConstRef
this class is used to manage the command-line or XML options.
double GetConnectionTime(const unsigned int first_operation, const unsigned int second_operation, const AbsControlStep cs) const
Return the connection time for a couple of operations or the phi overhead for a single operation...
tree_nodeRef create_ssa_name(const tree_nodeConstRef &var, const tree_nodeConstRef &type, const tree_nodeConstRef &min, const tree_nodeConstRef &max, bool volatile_flag=false, bool virtual_flag=false) const
MISCELLANEOUS_OBJ_TREE_NODES.
Analysis step restructing tree of commutative expressions to reduce the critical path delay...
refcount< tree_node > tree_nodeRef
RefCount type definition of the tree_node class structure.
Definition: tree_node.hpp:212
unsigned counter[N_THREADS]
Definition: data.c:3
int debug_level
The debug level.
double GetEndingTime(const unsigned int operation) const
Return the starting time of the operation.
Definition: schedule.cpp:1140
#define OUTPUT_LEVEL_VERBOSE
verbose debugging print is performed.
#define GET_INDEX_CONST_NODE(t)
Definition: tree_node.hpp:363
static bool is_constant(const tree_managerConstRef &TM, const unsigned int index)
Return if a tree node is a constant object.
Data structure definition for high-level synthesis flow.
tree_nodeRef create_gimple_modify_stmt(const tree_nodeRef &op0, const tree_nodeRef &op1, unsigned int function_decl_nid, const std::string &srcp) const
GIMPLE_ASSIGN.
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.
This class creates a layer to add nodes and to manipulate the tree_nodes manager. ...
Class specification of the manager of the tree structures extracted from the raw file.
const FunctionBehaviorRef function_behavior
The function behavior of the function to be analyzed.
int sl
Definition: adpcm.c:105
static const std::string ComputeSignature(const FrontendFlowStepType frontend_flow_step_type, const unsigned int function_id)
Compute the signature of a function frontend flow step.
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...
Definition: exceptions.hpp:289

Generated on Mon Feb 12 2024 13:02:52 for PandA-2024.02 by doxygen 1.8.13