PandA-2024.02
frontend_flow_step_factory.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) 2004-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  */
46 
48 #include "add_bb_ecfg_edges.hpp"
52 #include "bambu_frontend_flow.hpp"
54 #include "config_HAVE_FROM_PRAGMA_BUILT.hpp"
55 #include "config_HAVE_HOST_PROFILING_BUILT.hpp"
56 #include "config_HAVE_ILP_BUILT.hpp" // for HAVE_ILP_BUILT
57 #include "config_HAVE_PRAGMA_BUILT.hpp" // for HAVE_PRAGMA_B...
58 #include "config_HAVE_TASTE.hpp" // for HAVE_TASTE
59 #include "design_flow_step.hpp"
60 #include "exceptions.hpp" // for THROW_UNREACH...
61 #if HAVE_HOST_PROFILING_BUILT
63 #endif
64 #include "BitValueIPA.hpp"
65 #include "BitValueRange.hpp"
66 #include "Bit_Value.hpp"
67 #include "Bit_Value_opt.hpp"
68 #include "CSE.hpp"
69 #include "bb_cdg_computation.hpp"
71 #include "bb_order_computation.hpp"
73 #include "block_fix.hpp"
74 #include "build_virtual_phi.hpp"
75 #include "call_expr_fix.hpp"
78 #include "check_system_type.hpp"
80 #include "complete_bb_graph.hpp"
81 #include "complete_call_graph.hpp"
84 #if HAVE_TASTE
86 #endif
87 #include "create_tree_manager.hpp"
88 #include "dataflow_cg_ext.hpp"
94 #if HAVE_FROM_PRAGMA_BUILT
95 #include "extract_omp_atomic.hpp"
96 #include "extract_omp_for.hpp"
97 #endif
99 #include "FixVdef.hpp"
100 #include "FunctionCallOpt.hpp"
102 #include "HWCallInjection.hpp"
103 #include "IR_lowering.hpp"
104 #include "InterfaceInfer.hpp"
105 #include "NI_SSA_liveness.hpp"
107 #include "extract_patterns.hpp"
108 #include "fanout_opt.hpp"
109 #include "hdl_function_decl_fix.hpp"
110 #include "hdl_var_decl_fix.hpp"
111 #include "hls_div_cg_ext.hpp"
112 #include "loops_analysis_bambu.hpp"
113 #include "loops_computation.hpp"
114 #include "lut_transformation.hpp"
115 #include "multi_way_if.hpp"
116 #include "multiple_entry_if_reduction.hpp" //modified here
117 #include "op_cdg_computation.hpp"
119 #include "op_order_computation.hpp"
122 #include "parm2ssa.hpp"
124 #include "phi_opt.hpp"
125 #if HAVE_FROM_PRAGMA_BUILT
126 #include "pragma_substitution.hpp"
127 #endif
128 #include "predicate_statements.hpp"
129 #if HAVE_HOST_PROFILING_BUILT
130 #include "host_profiling.hpp"
131 #endif
132 #include "Range_Analysis.hpp"
133 #include "eSSA.hpp"
135 #include "remove_clobber_ga.hpp"
136 #include "remove_ending_if.hpp"
138 #include "sdc_code_motion.hpp"
140 #include "short_circuit_taf.hpp"
141 #include "simple_code_motion.hpp"
142 #include "soft_float_cg_ext.hpp"
143 #include "split_return.hpp"
144 #include "string_cst_fix.hpp"
145 #include "switch_fix.hpp"
147 #if HAVE_ILP_BUILT
148 #include "update_schedule.hpp"
149 #endif
150 #include "use_counting.hpp"
151 #include "var_computation.hpp"
152 #include "var_decl_fix.hpp"
153 #include "vectorize.hpp"
156 #if HAVE_FROM_PRAGMA_BUILT
157 #include "pragma_analysis.hpp"
158 #endif
160 
162  const DesignFlowManagerConstRef _design_flow_manager,
163  const ParameterConstRef _parameters)
164  : DesignFlowStepFactory(_design_flow_manager, _parameters), AppM(_AppM)
165 {
166 }
167 
169 
171  const CustomUnorderedSet<FrontendFlowStepType>& frontend_flow_step_types) const
172 {
173  DesignFlowStepSet frontend_flow_steps;
175  frontend_flow_step_type_end = frontend_flow_step_types.end();
176  for(frontend_flow_step_type = frontend_flow_step_types.begin();
177  frontend_flow_step_type != frontend_flow_step_type_end; ++frontend_flow_step_type)
178  {
179  frontend_flow_steps.insert(GenerateFrontendStep(*frontend_flow_step_type));
180  }
181  return frontend_flow_steps;
182 }
183 
184 const DesignFlowStepRef
186 {
187  switch(frontend_flow_step_type)
188  {
189  case ADD_BB_ECFG_EDGES:
190  case ADD_ARTIFICIAL_CALL_FLOW_EDGES:
191  case ADD_OP_EXIT_FLOW_EDGES:
192  case ADD_OP_LOOP_FLOW_EDGES:
193  case ADD_OP_PHI_FLOW_EDGES:
194  case BASIC_BLOCKS_CFG_COMPUTATION:
195  case BB_CONTROL_DEPENDENCE_COMPUTATION:
196  case BB_FEEDBACK_EDGES_IDENTIFICATION:
197  case BB_ORDER_COMPUTATION:
198  case BB_REACHABILITY_COMPUTATION:
199  case BIT_VALUE:
200  case BIT_VALUE_OPT:
201  case BITVALUE_RANGE:
202  case BLOCK_FIX:
203  case BUILD_VIRTUAL_PHI:
204  case CALL_EXPR_FIX:
205  case CALL_GRAPH_BUILTIN_CALL:
206  case CHECK_SYSTEM_TYPE:
207  case COMPLETE_BB_GRAPH:
208  case COMPUTE_IMPLICIT_CALLS:
209  case COMMUTATIVE_EXPR_RESTRUCTURING:
210  case COND_EXPR_RESTRUCTURING:
211  case CSE_STEP:
212  case DATAFLOW_CG_EXT:
213  case DEAD_CODE_ELIMINATION:
214  case DETERMINE_MEMORY_ACCESSES:
215  case DOM_POST_DOM_COMPUTATION:
216  case ESSA:
217  case(FANOUT_OPT):
218  case MULTIPLE_ENTRY_IF_REDUCTION:
219  case EXTRACT_GIMPLE_COND_OP:
220 #if HAVE_FROM_PRAGMA_BUILT
221  case EXTRACT_OMP_ATOMIC:
222  case EXTRACT_OMP_FOR:
223 #endif
224  case EXTRACT_PATTERNS:
225  case FUNCTION_CALL_TYPE_CLEANUP:
226  case FUNCTION_CALL_OPT:
227  case FIX_STRUCTS_PASSED_BY_VALUE:
228  case FIX_VDEF:
229  case HDL_VAR_DECL_FIX:
230  case HLS_DIV_CG_EXT:
231  case HWCALL_INJECTION:
232  case IR_LOWERING:
233  case LOOP_COMPUTATION:
234  case LOOPS_ANALYSIS_BAMBU:
235  case LOOPS_COMPUTATION:
236  case LUT_TRANSFORMATION:
237  case MULTI_WAY_IF:
238  case NI_SSA_LIVENESS:
239  case OP_CONTROL_DEPENDENCE_COMPUTATION:
240  case OP_FEEDBACK_EDGES_IDENTIFICATION:
241  case OP_ORDER_COMPUTATION:
242  case OP_REACHABILITY_COMPUTATION:
243  case OPERATIONS_CFG_COMPUTATION:
244  case PARM2SSA:
245  case PARM_DECL_TAKEN_ADDRESS:
246  case PHI_OPT:
247  case PREDICATE_STATEMENTS:
248  case REBUILD_INITIALIZATION:
249  case REBUILD_INITIALIZATION2:
250  case REMOVE_CLOBBER_GA:
251  case REMOVE_ENDING_IF:
252 #if HAVE_ILP_BUILT
253  case SDC_CODE_MOTION:
254 #endif
255  case SERIALIZE_MUTUAL_EXCLUSIONS:
256  case SPLIT_RETURN:
257  case SHORT_CIRCUIT_TAF:
258  case SIMPLE_CODE_MOTION:
259  case SOFT_FLOAT_CG_EXT:
260  case SCALAR_SSA_DATA_FLOW_ANALYSIS:
261  case SWITCH_FIX:
262 #if HAVE_ILP_BUILT
263  case UPDATE_SCHEDULE:
264 #endif
265  case UN_COMPARISON_LOWERING:
266  case UNROLLING_DEGREE:
267  case USE_COUNTING:
268  case VAR_ANALYSIS:
269  case VAR_DECL_FIX:
270  case VECTORIZE:
271  case VERIFICATION_OPERATION:
272  case VIRTUAL_AGGREGATE_DATA_FLOW_ANALYSIS:
273  case VIRTUAL_PHI_NODES_SPLIT:
274  {
275  return DesignFlowStepRef(new SymbolicApplicationFrontendFlowStep(AppM, frontend_flow_step_type,
277  }
278 #if HAVE_HOST_PROFILING_BUILT
279  case BASIC_BLOCKS_PROFILING:
280 #endif
281  case BAMBU_FRONTEND_FLOW:
282  case BIT_VALUE_IPA:
283  case INTERFACE_INFER:
284  case(COMPLETE_CALL_GRAPH):
285 #if HAVE_TASTE
286  case CREATE_ADDRESS_TRANSLATION:
287 #endif
288  case(CREATE_TREE_MANAGER):
289  case DEAD_CODE_ELIMINATION_IPA:
290  case FIND_MAX_TRANSFORMATIONS:
291  case FUNCTION_ANALYSIS:
292  case HDL_FUNCTION_DECL_FIX:
293 #if HAVE_HOST_PROFILING_BUILT
294  case HOST_PROFILING:
295 #endif
296 #if HAVE_FROM_PRAGMA_BUILT
297  case PRAGMA_ANALYSIS:
298 #endif
299 #if HAVE_FROM_PRAGMA_BUILT
300  case PRAGMA_SUBSTITUTION:
301 #endif
302  case RANGE_ANALYSIS:
303  case STRING_CST_FIX:
304  case(SYMBOLIC_APPLICATION_FRONTEND_FLOW_STEP):
305  {
306  return CreateApplicationFrontendFlowStep(frontend_flow_step_type);
307  }
308  default:
309  THROW_UNREACHABLE("Frontend flow step type does not exist");
310  }
311  return DesignFlowStepRef();
312 }
313 
314 const DesignFlowStepRef
316 {
317  switch(design_flow_step_type)
318  {
319 #if HAVE_HOST_PROFILING_BUILT
320  case BASIC_BLOCKS_PROFILING:
321  {
323  }
324 #endif
325  case BAMBU_FRONTEND_FLOW:
326  {
328  }
329  case BIT_VALUE_IPA:
330  {
332  }
333  case INTERFACE_INFER:
334  {
336  }
337  case(COMPLETE_CALL_GRAPH):
338  {
340  }
341 #if HAVE_TASTE
342  case CREATE_ADDRESS_TRANSLATION:
343  {
345  }
346 #endif
347  case(CREATE_TREE_MANAGER):
348  {
350  }
351  case DEAD_CODE_ELIMINATION_IPA:
352  {
354  }
355  case FIND_MAX_TRANSFORMATIONS:
356  {
358  }
359  case(FUNCTION_ANALYSIS):
360  {
362  }
363  case HDL_FUNCTION_DECL_FIX:
364  {
366  }
367 #if HAVE_HOST_PROFILING_BUILT
368  case(HOST_PROFILING):
369  {
371  }
372 #endif
373 #if HAVE_PRAGMA_BUILT
374  case PRAGMA_ANALYSIS:
375  {
377  }
378 #endif
379 #if HAVE_FROM_PRAGMA_BUILT
380  case(PRAGMA_SUBSTITUTION):
381  {
383  }
384 #endif
385  case RANGE_ANALYSIS:
386  {
388  }
389  case STRING_CST_FIX:
390  {
392  }
393  case ADD_BB_ECFG_EDGES:
394  case ADD_ARTIFICIAL_CALL_FLOW_EDGES:
395  case ADD_OP_EXIT_FLOW_EDGES:
396  case ADD_OP_LOOP_FLOW_EDGES:
397  case ADD_OP_PHI_FLOW_EDGES:
398  case BASIC_BLOCKS_CFG_COMPUTATION:
399  case BB_CONTROL_DEPENDENCE_COMPUTATION:
400  case BB_FEEDBACK_EDGES_IDENTIFICATION:
401  case BB_ORDER_COMPUTATION:
402  case BB_REACHABILITY_COMPUTATION:
403  case BIT_VALUE:
404  case BIT_VALUE_OPT:
405  case BITVALUE_RANGE:
406  case BLOCK_FIX:
407  case BUILD_VIRTUAL_PHI:
408  case CALL_EXPR_FIX:
409  case CALL_GRAPH_BUILTIN_CALL:
410  case CHECK_SYSTEM_TYPE:
411  case COMPLETE_BB_GRAPH:
412  case COMPUTE_IMPLICIT_CALLS:
413  case COMMUTATIVE_EXPR_RESTRUCTURING:
414  case COND_EXPR_RESTRUCTURING:
415  case CSE_STEP:
416  case DATAFLOW_CG_EXT:
417  case DEAD_CODE_ELIMINATION:
418  case DETERMINE_MEMORY_ACCESSES:
419  case DOM_POST_DOM_COMPUTATION:
420  case ESSA:
421  case(FANOUT_OPT):
422  case MULTIPLE_ENTRY_IF_REDUCTION:
423  case EXTRACT_GIMPLE_COND_OP:
424 #if HAVE_FROM_PRAGMA_BUILT
425  case EXTRACT_OMP_ATOMIC:
426  case EXTRACT_OMP_FOR:
427 #endif
428  case EXTRACT_PATTERNS:
429  case FUNCTION_CALL_TYPE_CLEANUP:
430  case FUNCTION_CALL_OPT:
431  case FIX_STRUCTS_PASSED_BY_VALUE:
432  case FIX_VDEF:
433  case HDL_VAR_DECL_FIX:
434  case HLS_DIV_CG_EXT:
435  case HWCALL_INJECTION:
436  case IR_LOWERING:
437  case LOOP_COMPUTATION:
438  case LOOPS_ANALYSIS_BAMBU:
439  case LOOPS_COMPUTATION:
440  case LUT_TRANSFORMATION:
441  case MULTI_WAY_IF:
442  case NI_SSA_LIVENESS:
443  case OP_CONTROL_DEPENDENCE_COMPUTATION:
444  case OP_FEEDBACK_EDGES_IDENTIFICATION:
445  case OP_ORDER_COMPUTATION:
446  case OP_REACHABILITY_COMPUTATION:
447  case OPERATIONS_CFG_COMPUTATION:
448  case PARM2SSA:
449  case PARM_DECL_TAKEN_ADDRESS:
450  case PHI_OPT:
451  case PREDICATE_STATEMENTS:
452  case REBUILD_INITIALIZATION:
453  case REBUILD_INITIALIZATION2:
454  case REMOVE_CLOBBER_GA:
455  case REMOVE_ENDING_IF:
456 #if HAVE_ILP_BUILT
457  case SDC_CODE_MOTION:
458 #endif
459  case SERIALIZE_MUTUAL_EXCLUSIONS:
460  case SPLIT_RETURN:
461  case SHORT_CIRCUIT_TAF:
462  case SIMPLE_CODE_MOTION:
463  case SOFT_FLOAT_CG_EXT:
464  case SCALAR_SSA_DATA_FLOW_ANALYSIS:
465  case SWITCH_FIX:
466  case UN_COMPARISON_LOWERING:
467  case UNROLLING_DEGREE:
468 #if HAVE_ILP_BUILT
469  case UPDATE_SCHEDULE:
470 #endif
471  case USE_COUNTING:
472  case VAR_ANALYSIS:
473  case VAR_DECL_FIX:
474  case VECTORIZE:
475  case VERIFICATION_OPERATION:
476  case VIRTUAL_AGGREGATE_DATA_FLOW_ANALYSIS:
477  case VIRTUAL_PHI_NODES_SPLIT:
478  {
479  THROW_UNREACHABLE("Trying to create an application flow step from " +
480  FrontendFlowStep::EnumToKindText(design_flow_step_type));
481  break;
482  }
483  case SYMBOLIC_APPLICATION_FRONTEND_FLOW_STEP:
484  {
485  THROW_UNREACHABLE("Symbolic Application Frontend Flow Step must be created by GenerateFrontendSteps");
486  break;
487  }
488  default:
489  THROW_UNREACHABLE("Frontend flow step type does not exist");
490  }
491  return DesignFlowStepRef();
492 }
493 
494 const DesignFlowStepRef
496  const unsigned int function_id) const
497 {
498  switch(design_flow_step_type)
499  {
500  case ADD_BB_ECFG_EDGES:
501  {
503  }
504  case ADD_ARTIFICIAL_CALL_FLOW_EDGES:
505  {
506  return DesignFlowStepRef(
508  }
509  case ADD_OP_EXIT_FLOW_EDGES:
510  {
512  }
513  case ADD_OP_LOOP_FLOW_EDGES:
514  {
516  }
517  case ADD_OP_PHI_FLOW_EDGES:
518  {
520  }
521  case BASIC_BLOCKS_CFG_COMPUTATION:
522  {
523  return DesignFlowStepRef(
525  }
526  case BB_CONTROL_DEPENDENCE_COMPUTATION:
527  {
529  }
530  case BB_FEEDBACK_EDGES_IDENTIFICATION:
531  {
532  return DesignFlowStepRef(
534  }
535  case BB_ORDER_COMPUTATION:
536  {
538  }
539  case BB_REACHABILITY_COMPUTATION:
540  {
541  return DesignFlowStepRef(
543  }
544  case BIT_VALUE:
545  {
546  return DesignFlowStepRef(new Bit_Value(parameters, AppM, function_id, design_flow_manager.lock()));
547  }
548  case BIT_VALUE_OPT:
549  {
551  }
552  case BITVALUE_RANGE:
553  {
555  }
556  case BLOCK_FIX:
557  {
558  return DesignFlowStepRef(new BlockFix(AppM, function_id, design_flow_manager.lock(), parameters));
559  }
560  case BUILD_VIRTUAL_PHI:
561  {
563  }
564  case CALL_EXPR_FIX:
565  {
567  }
568  case CALL_GRAPH_BUILTIN_CALL:
569  {
571  }
572  case CHECK_SYSTEM_TYPE:
573  {
575  }
576  case COMPLETE_BB_GRAPH:
577  {
579  }
580  case COMPUTE_IMPLICIT_CALLS:
581  {
582  return DesignFlowStepRef(
584  }
585  case COMMUTATIVE_EXPR_RESTRUCTURING:
586  {
587  return DesignFlowStepRef(
589  }
590  case COND_EXPR_RESTRUCTURING:
591  {
593  }
594  case CSE_STEP:
595  {
596  return DesignFlowStepRef(new CSE(parameters, AppM, function_id, design_flow_manager.lock()));
597  }
598  case DATAFLOW_CG_EXT:
599  {
601  }
602  case DEAD_CODE_ELIMINATION:
603  {
605  }
606  case DETERMINE_MEMORY_ACCESSES:
607  {
608  return DesignFlowStepRef(
610  }
611  case DOM_POST_DOM_COMPUTATION:
612  {
613  return DesignFlowStepRef(
615  }
616  case(ESSA):
617  {
618  return DesignFlowStepRef(new eSSA(parameters, AppM, function_id, design_flow_manager.lock()));
619  }
620  case(FANOUT_OPT):
621  {
622  return DesignFlowStepRef(new fanout_opt(parameters, AppM, function_id, design_flow_manager.lock()));
623  }
624  case(MULTIPLE_ENTRY_IF_REDUCTION):
625  {
626  return DesignFlowStepRef(
628  }
629  case EXTRACT_GIMPLE_COND_OP:
630  {
632  }
633 #if HAVE_FROM_PRAGMA_BUILT
634  case EXTRACT_OMP_ATOMIC:
635  {
637  }
638  case EXTRACT_OMP_FOR:
639  {
641  }
642 #endif
643  case EXTRACT_PATTERNS:
644  {
646  }
647  case FIX_STRUCTS_PASSED_BY_VALUE:
648  {
649  return DesignFlowStepRef(
651  }
652  case FIX_VDEF:
653  {
654  return DesignFlowStepRef(new FixVdef(parameters, AppM, function_id, design_flow_manager.lock()));
655  }
656  case FUNCTION_CALL_TYPE_CLEANUP:
657  {
658  return DesignFlowStepRef(
660  }
661  case FUNCTION_CALL_OPT:
662  {
664  }
665  case HDL_VAR_DECL_FIX:
666  {
668  }
669  case HLS_DIV_CG_EXT:
670  {
672  }
673  case HWCALL_INJECTION:
674  {
676  }
677  case IR_LOWERING:
678  {
680  }
681  case LOOP_COMPUTATION:
682  {
684  }
685  case LOOPS_ANALYSIS_BAMBU:
686  {
688  }
689  case LOOPS_COMPUTATION:
690  {
692  }
693  case LUT_TRANSFORMATION:
694  {
696  }
697  case MULTI_WAY_IF:
698  {
700  }
701  case NI_SSA_LIVENESS:
702  {
704  }
705  case OP_CONTROL_DEPENDENCE_COMPUTATION:
706  {
708  }
709  case OP_FEEDBACK_EDGES_IDENTIFICATION:
710  {
711  return DesignFlowStepRef(
713  }
714  case OP_ORDER_COMPUTATION:
715  {
717  }
718  case OP_REACHABILITY_COMPUTATION:
719  {
720  return DesignFlowStepRef(
722  }
723  case OPERATIONS_CFG_COMPUTATION:
724  {
725  return DesignFlowStepRef(
727  }
728  case PARM2SSA:
729  {
730  return DesignFlowStepRef(new parm2ssa(parameters, AppM, function_id, design_flow_manager.lock()));
731  }
732  case PARM_DECL_TAKEN_ADDRESS:
733  {
734  return DesignFlowStepRef(
736  }
737  case PHI_OPT:
738  {
739  return DesignFlowStepRef(new PhiOpt(AppM, function_id, design_flow_manager.lock(), parameters));
740  }
741  case PREDICATE_STATEMENTS:
742  {
744  }
745  case REBUILD_INITIALIZATION:
746  {
747  return DesignFlowStepRef(
749  }
750  case REBUILD_INITIALIZATION2:
751  {
752  return DesignFlowStepRef(
754  }
755  case REMOVE_CLOBBER_GA:
756  {
758  }
759  case REMOVE_ENDING_IF:
760  {
762  }
763 #if HAVE_ILP_BUILT
764  case SDC_CODE_MOTION:
765  {
767  }
768 #endif
769  case SERIALIZE_MUTUAL_EXCLUSIONS:
770  {
771  return DesignFlowStepRef(
773  }
774  case SPLIT_RETURN:
775  {
777  }
778  case SHORT_CIRCUIT_TAF:
779  {
781  }
782  case SIMPLE_CODE_MOTION:
783  {
785  }
786  case SOFT_FLOAT_CG_EXT:
787  {
789  }
790  case SCALAR_SSA_DATA_FLOW_ANALYSIS:
791  {
792  return DesignFlowStepRef(
794  }
795  case SWITCH_FIX:
796  {
797  return DesignFlowStepRef(new SwitchFix(AppM, function_id, design_flow_manager.lock(), parameters));
798  }
799  case UN_COMPARISON_LOWERING:
800  {
802  }
803  case UNROLLING_DEGREE:
804  {
805  THROW_UNREACHABLE("Not updated step");
806  break;
807  }
808 
809 #if HAVE_ILP_BUILT
810  case UPDATE_SCHEDULE:
811  {
813  }
814 #endif
815  case USE_COUNTING:
816  {
818  }
819  case VAR_ANALYSIS:
820  {
822  }
823  case VAR_DECL_FIX:
824  {
825  return DesignFlowStepRef(new VarDeclFix(AppM, function_id, design_flow_manager.lock(), parameters));
826  }
827  case VECTORIZE:
828  {
829  return DesignFlowStepRef(new Vectorize(AppM, function_id, design_flow_manager.lock(), parameters));
830  }
831  case VERIFICATION_OPERATION:
832  {
833  THROW_UNREACHABLE("Not updated step");
834  break;
835  }
836  case VIRTUAL_AGGREGATE_DATA_FLOW_ANALYSIS:
837  {
838  return DesignFlowStepRef(
840  }
841  case VIRTUAL_PHI_NODES_SPLIT:
842  {
843  return DesignFlowStepRef(
845  }
846 #if HAVE_HOST_PROFILING_BUILT
847  case BASIC_BLOCKS_PROFILING:
848 #endif
849  case BAMBU_FRONTEND_FLOW:
850  case BIT_VALUE_IPA:
851  case INTERFACE_INFER:
852  case(COMPLETE_CALL_GRAPH):
853 #if HAVE_TASTE
854  case CREATE_ADDRESS_TRANSLATION:
855 #endif
856  case(CREATE_TREE_MANAGER):
857  case DEAD_CODE_ELIMINATION_IPA:
858  case FIND_MAX_TRANSFORMATIONS:
859  case(FUNCTION_ANALYSIS):
860  case HDL_FUNCTION_DECL_FIX:
861 #if HAVE_HOST_PROFILING_BUILT
862  case(HOST_PROFILING):
863 #endif
864 #if HAVE_PRAGMA_BUILT
865  case(PRAGMA_ANALYSIS):
866 #endif
867 #if HAVE_FROM_PRAGMA_BUILT
868  case(PRAGMA_SUBSTITUTION):
869 #endif
870  case RANGE_ANALYSIS:
871  case STRING_CST_FIX:
872  case(SYMBOLIC_APPLICATION_FRONTEND_FLOW_STEP):
873  {
874  THROW_UNREACHABLE("Trying to create a function frontend flow step from " +
875  FrontendFlowStep::EnumToKindText(design_flow_step_type));
876  break;
877  }
878  default:
879  THROW_UNREACHABLE("Frontend flow step type does not exist");
880  }
881  return DesignFlowStepRef();
882 }
883 
884 const std::string FrontendFlowStepFactory::GetPrefix() const
885 {
886  return "Frontend";
887 }
Compute the feedback edges of the basic block control flow graph.
Rebuild initialization function flow front-end step.
This class contains the methods for vectorize loop or whole function.
const std::string GetPrefix() const override
Return the prefix of the steps created by the factory.
Analysis step that removes clobber gimple_assign introduced by GCC v4.7 and greater.
Analysis step that extract condition from gimple_cond.
Analysis step which adds flow edges from the computation of the condition(s) of gimple_cond and gimpl...
const ParameterConstRef parameters
The set of input parameters.
Analyzes operations and creates the sets of read and written variables.
Build call_graph data structure starting from the tree_manager.
Superclass include.
Definition: switch_fix.hpp:53
Analysis step which adds flow edges for scheduling to operation graphs.
Class that creates the tree_manager starting from the source code files.
Superclass include.
const DesignFlowStepSet GenerateFrontendSteps(const CustomUnorderedSet< FrontendFlowStepType > &frontend_flow_step_types) const
Create the frontend design flow steps.
Analysis step rebuilding a short circuit in a single gimple_cond with the condition in three address ...
Analysis step performing aggregate variable computation on the basis of gcc virtual operands...
This class contains the methods for remove mutual exclusions from simd loops.
Determine variables to be stored in memory.
Class which creates source code of hdl module to translate addresses from pci address space to bambu ...
Class performing some optimizations on the IR exploiting Bit Value analysis but executed after Range ...
Analysis step creating the control flow graph for the operations.
Class that creates the tree_manager starting from the source code files.
exceptions managed by PandA
loops computation analysis step
static const std::string EnumToKindText(const FrontendFlowStepType frontend_flow_step_type)
Given a frontend flow step type, return the name of the type.
Superclass include.
Class performing the reduction of n input - m output BB by duplicating the BB over all its predecesso...
Analysis step that optimize the phis starting from the IR.
Full implementation of Bit Value analysis as described in BitValue Inference: Detecting and Exploitin...
Analysis step building phi of vops.
Restructure the tree control flow graph.
Superclass include.
Analysis step which adds flow edges for scheduling to operation graphs.
Non-Iterative liveness analysis for SSA based gimple descriptions.
Analysis step performing dominators and post dominators computation.
Class to extend basic block cfg.
Writes source code of hdl module to translate addresses from pci address space to bambu address space...
Analysis step computing reachability between basic blocks.
Pre-analysis step.
Analysis step computing reachability between operations.
Class extracting patterns extending the GCC/CLANG IR.
Build call graph structures starting from the tree_manager.
identify and optmize lut expressions.
Class to perform adding of flow edges to operation graph.
Superclass include.
Analysis step computing a topological order of the operations.
Pre-analysis step computing the relation between parm_decl and the associated ssa_name.
Inter-Procedural extension of the Bit Value analysis as described in BitValue Inference: Detecting an...
Definition: BitValueIPA.hpp:59
Definition: eSSA.hpp:58
Superclass include.
Pre-analysis step.
Class performing some optimizations on the IR exploiting Bit Value analysis.
Step that extends the call graph with the division and modulus function calls where appropriate...
Class to perform profiling.
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached
Definition: exceptions.hpp:292
Restructure the tree control flow graph.
Definition: block_fix.hpp:66
Analysis step which fix a non-void list of parameters to function with void as input parameter type...
Pre-analysis step fixing readonly initializations and string_cst references.
Base class for step of design flow.
Superclass include.
merge memory dependencies in virtual dependencies
Analysis step computing basic block control dependencies.
This class models the ending of execution of all functions which can add a function to call graph...
Class to perform adding of flow edges to operation graph.
Update schedule of all the instructions.
Analysis step performing a dynamic profiling of basic blocks execution.
Build basic block control flow graph data structure starting from the tree_manager.
Analysis step counting how many time a ssa_name is used.
Abstract class for passes performing a dynamic profiling of loops, paths or both by means of predepen...
Class to find the maximum admissible value of max-transformations.
Superclass include.
Analysis step which adds flow edges to builtin bambu time functions.
const DesignFlowStepRef CreateApplicationFrontendFlowStep(const FrontendFlowStepType design_flow_step_type) const
Create an application frontend flow step.
Analysis step restructing tree of cond_expr to reduce critical path delay.
Superclass include.
Pass to add function called through pointers to the call graph.
Analysis step extracting openmp atomic.
Pre-analysis step fixing var_decl duplication.
Dataflow call graph extension.
Analysis step rebuilding multi-way if.
Load parsed protocol interface attributes.
Restructure the tree control flow graph.
const DesignFlowStepRef CreateFunctionFrontendFlowStep(const FrontendFlowStepType design_flow_step_type, const unsigned int function_id) const
Create a function frontend flow step.
STL include.
Eliminate dead code.
Step that replace uneq_expr, ltgt_expr, unge_expr, ungt_expr, unle_expr and unlt_expr.
Compute the control flow graph for the operations.
Definition: IR_lowering.hpp:84
Analysis step which extends basic block cfg.
Superclass include.
analyse srcp of variables and types to detect system ones; the identified one are flagged ...
Analysis step performing loops computation.
Structure the original short circuit.
Step that extends the call graph with the soft-float calls where appropriate.
loops computation analysis step
FrontendFlowStepFactory(const application_managerRef AppM, const DesignFlowManagerConstRef design_flow_manager, const ParameterConstRef parameters)
Constructor.
STL include.
Superclass include.
enum FrontendFlowStepType { CREATE_TREE_MANAGER, FIND_MAX_TRANSFORMATIONS, FUNCTION_ANALYSIS, SYMBOLIC_APPLICATION_FRONTEND_FLOW_STEP, ADD_BB_ECFG_EDGES, ADD_ARTIFICIAL_CALL_FLOW_EDGES, ADD_OP_EXIT_FLOW_EDGES, ADD_OP_LOOP_FLOW_EDGES, ADD_OP_PHI_FLOW_EDGES, BAMBU_FRONTEND_FLOW, BASIC_BLOCKS_CFG_COMPUTATION, BB_CONTROL_DEPENDENCE_COMPUTATION, BB_FEEDBACK_EDGES_IDENTIFICATION, BB_ORDER_COMPUTATION, BB_REACHABILITY_COMPUTATION, BIT_VALUE, BIT_VALUE_OPT, BITVALUE_RANGE, BIT_VALUE_IPA, BLOCK_FIX, BUILD_VIRTUAL_PHI, CALL_EXPR_FIX, CALL_GRAPH_BUILTIN_CALL, CHECK_SYSTEM_TYPE, COMPLETE_BB_GRAPH, COMPLETE_CALL_GRAPH, COMPUTE_IMPLICIT_CALLS, COMMUTATIVE_EXPR_RESTRUCTURING, COND_EXPR_RESTRUCTURING, CSE_STEP, DATAFLOW_CG_EXT, DEAD_CODE_ELIMINATION, DEAD_CODE_ELIMINATION_IPA, DETERMINE_MEMORY_ACCESSES, DOM_POST_DOM_COMPUTATION, EXTRACT_GIMPLE_COND_OP, EXTRACT_PATTERNS, FIX_STRUCTS_PASSED_BY_VALUE, FUNCTION_CALL_TYPE_CLEANUP, FUNCTION_CALL_OPT, FANOUT_OPT, FIX_VDEF, HDL_FUNCTION_DECL_FIX, HDL_VAR_DECL_FIX, HLS_DIV_CG_EXT, HWCALL_INJECTION, INTERFACE_INFER, IR_LOWERING, LOOP_COMPUTATION, LOOPS_ANALYSIS_BAMBU, LOOPS_COMPUTATION, LUT_TRANSFORMATION, MULTI_WAY_IF, MULTIPLE_ENTRY_IF_REDUCTION, NI_SSA_LIVENESS, OP_CONTROL_DEPENDENCE_COMPUTATION, OP_FEEDBACK_EDGES_IDENTIFICATION, OP_ORDER_COMPUTATION, OP_REACHABILITY_COMPUTATION, OPERATIONS_CFG_COMPUTATION, PARM2SSA, PARM_DECL_TAKEN_ADDRESS, PHI_OPT, PREDICATE_STATEMENTS, ESSA, RANGE_ANALYSIS, REBUILD_INITIALIZATION, REBUILD_INITIALIZATION2, REMOVE_CLOBBER_GA, REMOVE_ENDING_IF, SCALAR_SSA_DATA_FLOW_ANALYSIS, SERIALIZE_MUTUAL_EXCLUSIONS, SPLIT_RETURN, SHORT_CIRCUIT_TAF, SIMPLE_CODE_MOTION, SOFT_FLOAT_CG_EXT, STRING_CST_FIX, SWITCH_FIX, UN_COMPARISON_LOWERING, UNROLLING_DEGREE, USE_COUNTING, VAR_ANALYSIS, VAR_DECL_FIX, VECTORIZE, VERIFICATION_OPERATION, VIRTUAL_AGGREGATE_DATA_FLOW_ANALYSIS, VIRTUAL_PHI_NODES_SPLIT } FrontendFlowStepType
Pre-analysis step fixing var_decl duplication and HDL name conflicts.
Analysis step which updates the schedule of all the instructions.
This class contains the methods for setting predicates of instructions which cannot be speculated...
Class performing some optimizations on the IR exploiting Bit Value analysis.
Pre-analysis step.
Definition: parm2ssa.hpp:66
This class models the ending of execution of all steps which can modify control flow graph of basic b...
refcount< T > lock() const
Definition: refcount.hpp:212
Class which system_flag to tree_node of variables and types when necessary.
Restructure the tree control flow graph.
Analysis step that performs some simple code motions over the IR.
Analysis step performing code motion speculation on the basis of sdc results.
rebuild initialization where it is possible
Analysis step extracting openmp for.
Pre-analysis step.
Add to the call graph the function calls associated with the integer division and modulus operations...
refcount< DesignFlowStep > DesignFlowStepRef
CSE analysis.
Inter-procedural dead code elimination analysis.
Decompose some complex gimple statements into set of simple operations.
Analysis step computing feedback edges for operation control flow graph.
Superclass include.
CSE analysis.
Definition: CSE.hpp:89
Created on: June 27, 2016.
const Wrefcount< const DesignFlowManager > design_flow_manager
The design flow manager.
const application_managerRef AppM
The application manager.
Analysis step that recognizes the pragma calls in the specification.
This class contains the methods to create a frontend flow step.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
Definition: refcount.hpp:94
Class extracting patterns extending the GCC/CLANG IR.
Fanout optimization step.
Compute the control flow graph for the operations.
Analysis step that modifies the control flow graph to fix switches.
~FrontendFlowStepFactory() override
Destructor.
Restructure the tree control flow graph.
Definition: phi_opt.hpp:87
Analysis step restructing tree of commutative expressions to reduce the critical path delay...
Class to perform profiling.
Superclass include.
Compute the feedback edges of the operations graphs.
Superclass include.
Class performing some optimizations exploiting the reduction of BB with n inputs and m outputs...
Rebuild initialization function flow front-end step done after IR_lowering.
fanout_opt analysis
Definition: fanout_opt.hpp:62
Analysis step performing data flow analysis based on ssa variables.
Analysis step computing operation control dependencies.
Analysis step that modifies the control flow graph of the tree to make it more compliant.
loops computation analysis step
The step representing the frontend flow for bambu.
Determine variables to be stored in memory.
const DesignFlowStepRef GenerateFrontendStep(FrontendFlowStepType frontend_flow_step_type) const
Create the frontend design flow step.
Analysis step that replaces the pragmas in the specification with calls.
Full implementation of Bit Value analysis as described in BitValue Inference: Detecting and Exploitin...
Definition: Bit_Value.hpp:79
Pre-analysis step fixing names of functions which clash with signal names.
Add to the call graph the function calls associated with the floating point primitive operations...
This file contains the declaration of the CallGraphBuiltinCall pass that will add function called thr...
This class models the application of a analysis to all the functions of an application.
Analysis step to find transformation which breaks synthesis flow by launching bambu with different va...
Superclass include.
Compute the control flow graph for the operations.
Definition: FixVdef.hpp:55

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