-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathfrontend_flow_step_factory.cpp
887 lines (877 loc) · 30.4 KB
/
frontend_flow_step_factory.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
/*
*
* _/_/_/ _/_/ _/ _/ _/_/_/ _/_/
* _/ _/ _/ _/ _/_/ _/ _/ _/ _/ _/
* _/_/_/ _/_/_/_/ _/ _/_/ _/ _/ _/_/_/_/
* _/ _/ _/ _/ _/ _/ _/ _/ _/
* _/ _/ _/ _/ _/ _/_/_/ _/ _/
*
* ***********************************************
* PandA Project
* URL: http://panda.dei.polimi.it
* Politecnico di Milano - DEIB
* System Architectures Group
* ***********************************************
* Copyright (C) 2004-2024 Politecnico di Milano
*
* This file is part of the PandA framework.
*
* The PandA framework is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
* @file frontend_flow_step_factory.hpp
* @brief This class contains the methods to create a frontend flow step
*
* @author Marco Lattuada <[email protected]>
* $Revision$
* $Date$
* Last modified by $Author$
*
*/
/// Header include
#include "frontend_flow_step_factory.hpp"
#include "AddArtificialCallFlowEdges.hpp"
#include "add_bb_ecfg_edges.hpp"
#include "add_op_exit_flow_edges.hpp"
#include "add_op_loop_flow_edges.hpp"
#include "add_op_phi_flow_edges.hpp"
#include "bambu_frontend_flow.hpp"
#include "basic_blocks_cfg_computation.hpp"
#include "config_HAVE_FROM_PRAGMA_BUILT.hpp"
#include "config_HAVE_HOST_PROFILING_BUILT.hpp"
#include "config_HAVE_ILP_BUILT.hpp" // for HAVE_ILP_BUILT
#include "config_HAVE_PRAGMA_BUILT.hpp" // for HAVE_PRAGMA_B...
#include "config_HAVE_TASTE.hpp" // for HAVE_TASTE
#include "design_flow_step.hpp"
#include "exceptions.hpp" // for THROW_UNREACH...
#if HAVE_HOST_PROFILING_BUILT
#include "basic_blocks_profiling.hpp"
#endif
#include "BitValueIPA.hpp"
#include "BitValueRange.hpp"
#include "Bit_Value.hpp"
#include "Bit_Value_opt.hpp"
#include "CSE.hpp"
#include "bb_cdg_computation.hpp"
#include "bb_feedback_edges_computation.hpp"
#include "bb_order_computation.hpp"
#include "bb_reachability_computation.hpp"
#include "block_fix.hpp"
#include "build_virtual_phi.hpp"
#include "call_expr_fix.hpp"
#include "call_graph_builtin_call.hpp"
#include "call_graph_computation.hpp"
#include "check_system_type.hpp"
#include "commutative_expr_restructuring.hpp"
#include "complete_bb_graph.hpp"
#include "complete_call_graph.hpp"
#include "compute_implicit_calls.hpp"
#include "cond_expr_restructuring.hpp"
#if HAVE_TASTE
#include "create_address_translation.hpp"
#endif
#include "create_tree_manager.hpp"
#include "dataflow_cg_ext.hpp"
#include "dead_code_elimination.hpp"
#include "dead_code_eliminationIPA.hpp"
#include "determine_memory_accesses.hpp"
#include "dom_post_dom_computation.hpp"
#include "find_max_transformations.hpp"
#if HAVE_FROM_PRAGMA_BUILT
#include "extract_omp_atomic.hpp"
#include "extract_omp_for.hpp"
#endif
#include "FixStructsPassedByValue.hpp"
#include "FixVdef.hpp"
#include "FunctionCallOpt.hpp"
#include "FunctionCallTypeCleanup.hpp"
#include "HWCallInjection.hpp"
#include "IR_lowering.hpp"
#include "InterfaceInfer.hpp"
#include "NI_SSA_liveness.hpp"
#include "extract_gimple_cond_op.hpp"
#include "extract_patterns.hpp"
#include "fanout_opt.hpp"
#include "hdl_function_decl_fix.hpp"
#include "hdl_var_decl_fix.hpp"
#include "hls_div_cg_ext.hpp"
#include "loops_analysis_bambu.hpp"
#include "loops_computation.hpp"
#include "lut_transformation.hpp"
#include "multi_way_if.hpp"
#include "multiple_entry_if_reduction.hpp" //modified here
#include "op_cdg_computation.hpp"
#include "op_feedback_edges_computation.hpp"
#include "op_order_computation.hpp"
#include "op_reachability_computation.hpp"
#include "operations_cfg_computation.hpp"
#include "parm2ssa.hpp"
#include "parm_decl_taken_address_fix.hpp"
#include "phi_opt.hpp"
#if HAVE_FROM_PRAGMA_BUILT
#include "pragma_substitution.hpp"
#endif
#include "predicate_statements.hpp"
#if HAVE_HOST_PROFILING_BUILT
#include "host_profiling.hpp"
#endif
#include "Range_Analysis.hpp"
#include "eSSA.hpp"
#include "rebuild_initializations.hpp"
#include "remove_clobber_ga.hpp"
#include "remove_ending_if.hpp"
#include "scalar_ssa_data_dependence_computation.hpp"
#include "sdc_code_motion.hpp"
#include "serialize_mutual_exclusions.hpp"
#include "short_circuit_taf.hpp"
#include "simple_code_motion.hpp"
#include "soft_float_cg_ext.hpp"
#include "split_return.hpp"
#include "string_cst_fix.hpp"
#include "switch_fix.hpp"
#include "un_comparison_lowering.hpp"
#if HAVE_ILP_BUILT
#include "update_schedule.hpp"
#endif
#include "use_counting.hpp"
#include "var_computation.hpp"
#include "var_decl_fix.hpp"
#include "vectorize.hpp"
#include "virtual_aggregate_data_flow_analysis.hpp"
#include "virtual_phi_nodes_split.hpp"
#if HAVE_FROM_PRAGMA_BUILT
#include "pragma_analysis.hpp"
#endif
#include "symbolic_application_frontend_flow_step.hpp"
FrontendFlowStepFactory::FrontendFlowStepFactory(const application_managerRef _AppM,
const DesignFlowManagerConstRef _design_flow_manager,
const ParameterConstRef _parameters)
: DesignFlowStepFactory(_design_flow_manager, _parameters), AppM(_AppM)
{
}
FrontendFlowStepFactory::~FrontendFlowStepFactory() = default;
const DesignFlowStepSet FrontendFlowStepFactory::GenerateFrontendSteps(
const CustomUnorderedSet<FrontendFlowStepType>& frontend_flow_step_types) const
{
DesignFlowStepSet frontend_flow_steps;
CustomUnorderedSet<FrontendFlowStepType>::const_iterator frontend_flow_step_type,
frontend_flow_step_type_end = frontend_flow_step_types.end();
for(frontend_flow_step_type = frontend_flow_step_types.begin();
frontend_flow_step_type != frontend_flow_step_type_end; ++frontend_flow_step_type)
{
frontend_flow_steps.insert(GenerateFrontendStep(*frontend_flow_step_type));
}
return frontend_flow_steps;
}
const DesignFlowStepRef
FrontendFlowStepFactory::GenerateFrontendStep(FrontendFlowStepType frontend_flow_step_type) const
{
switch(frontend_flow_step_type)
{
case ADD_BB_ECFG_EDGES:
case ADD_ARTIFICIAL_CALL_FLOW_EDGES:
case ADD_OP_EXIT_FLOW_EDGES:
case ADD_OP_LOOP_FLOW_EDGES:
case ADD_OP_PHI_FLOW_EDGES:
case BASIC_BLOCKS_CFG_COMPUTATION:
case BB_CONTROL_DEPENDENCE_COMPUTATION:
case BB_FEEDBACK_EDGES_IDENTIFICATION:
case BB_ORDER_COMPUTATION:
case BB_REACHABILITY_COMPUTATION:
case BIT_VALUE:
case BIT_VALUE_OPT:
case BITVALUE_RANGE:
case BLOCK_FIX:
case BUILD_VIRTUAL_PHI:
case CALL_EXPR_FIX:
case CALL_GRAPH_BUILTIN_CALL:
case CHECK_SYSTEM_TYPE:
case COMPLETE_BB_GRAPH:
case COMPUTE_IMPLICIT_CALLS:
case COMMUTATIVE_EXPR_RESTRUCTURING:
case COND_EXPR_RESTRUCTURING:
case CSE_STEP:
case DATAFLOW_CG_EXT:
case DEAD_CODE_ELIMINATION:
case DETERMINE_MEMORY_ACCESSES:
case DOM_POST_DOM_COMPUTATION:
case ESSA:
case(FANOUT_OPT):
case MULTIPLE_ENTRY_IF_REDUCTION:
case EXTRACT_GIMPLE_COND_OP:
#if HAVE_FROM_PRAGMA_BUILT
case EXTRACT_OMP_ATOMIC:
case EXTRACT_OMP_FOR:
#endif
case EXTRACT_PATTERNS:
case FUNCTION_CALL_TYPE_CLEANUP:
case FUNCTION_CALL_OPT:
case FIX_STRUCTS_PASSED_BY_VALUE:
case FIX_VDEF:
case HDL_VAR_DECL_FIX:
case HLS_DIV_CG_EXT:
case HWCALL_INJECTION:
case IR_LOWERING:
case LOOP_COMPUTATION:
case LOOPS_ANALYSIS_BAMBU:
case LOOPS_COMPUTATION:
case LUT_TRANSFORMATION:
case MULTI_WAY_IF:
case NI_SSA_LIVENESS:
case OP_CONTROL_DEPENDENCE_COMPUTATION:
case OP_FEEDBACK_EDGES_IDENTIFICATION:
case OP_ORDER_COMPUTATION:
case OP_REACHABILITY_COMPUTATION:
case OPERATIONS_CFG_COMPUTATION:
case PARM2SSA:
case PARM_DECL_TAKEN_ADDRESS:
case PHI_OPT:
case PREDICATE_STATEMENTS:
case REBUILD_INITIALIZATION:
case REBUILD_INITIALIZATION2:
case REMOVE_CLOBBER_GA:
case REMOVE_ENDING_IF:
#if HAVE_ILP_BUILT
case SDC_CODE_MOTION:
#endif
case SERIALIZE_MUTUAL_EXCLUSIONS:
case SPLIT_RETURN:
case SHORT_CIRCUIT_TAF:
case SIMPLE_CODE_MOTION:
case SOFT_FLOAT_CG_EXT:
case SCALAR_SSA_DATA_FLOW_ANALYSIS:
case SWITCH_FIX:
#if HAVE_ILP_BUILT
case UPDATE_SCHEDULE:
#endif
case UN_COMPARISON_LOWERING:
case UNROLLING_DEGREE:
case USE_COUNTING:
case VAR_ANALYSIS:
case VAR_DECL_FIX:
case VECTORIZE:
case VERIFICATION_OPERATION:
case VIRTUAL_AGGREGATE_DATA_FLOW_ANALYSIS:
case VIRTUAL_PHI_NODES_SPLIT:
{
return DesignFlowStepRef(new SymbolicApplicationFrontendFlowStep(AppM, frontend_flow_step_type,
design_flow_manager.lock(), parameters));
}
#if HAVE_HOST_PROFILING_BUILT
case BASIC_BLOCKS_PROFILING:
#endif
case BAMBU_FRONTEND_FLOW:
case BIT_VALUE_IPA:
case INTERFACE_INFER:
case(COMPLETE_CALL_GRAPH):
#if HAVE_TASTE
case CREATE_ADDRESS_TRANSLATION:
#endif
case(CREATE_TREE_MANAGER):
case DEAD_CODE_ELIMINATION_IPA:
case FIND_MAX_TRANSFORMATIONS:
case FUNCTION_ANALYSIS:
case HDL_FUNCTION_DECL_FIX:
#if HAVE_HOST_PROFILING_BUILT
case HOST_PROFILING:
#endif
#if HAVE_FROM_PRAGMA_BUILT
case PRAGMA_ANALYSIS:
#endif
#if HAVE_FROM_PRAGMA_BUILT
case PRAGMA_SUBSTITUTION:
#endif
case RANGE_ANALYSIS:
case STRING_CST_FIX:
case(SYMBOLIC_APPLICATION_FRONTEND_FLOW_STEP):
{
return CreateApplicationFrontendFlowStep(frontend_flow_step_type);
}
default:
THROW_UNREACHABLE("Frontend flow step type does not exist");
}
return DesignFlowStepRef();
}
const DesignFlowStepRef
FrontendFlowStepFactory::CreateApplicationFrontendFlowStep(const FrontendFlowStepType design_flow_step_type) const
{
switch(design_flow_step_type)
{
#if HAVE_HOST_PROFILING_BUILT
case BASIC_BLOCKS_PROFILING:
{
return DesignFlowStepRef(new BasicBlocksProfiling(AppM, design_flow_manager.lock(), parameters));
}
#endif
case BAMBU_FRONTEND_FLOW:
{
return DesignFlowStepRef(new BambuFrontendFlow(AppM, design_flow_manager.lock(), parameters));
}
case BIT_VALUE_IPA:
{
return DesignFlowStepRef(new BitValueIPA(AppM, design_flow_manager.lock(), parameters));
}
case INTERFACE_INFER:
{
return DesignFlowStepRef(new InterfaceInfer(AppM, design_flow_manager.lock(), parameters));
}
case(COMPLETE_CALL_GRAPH):
{
return DesignFlowStepRef(new CompleteCallGraph(AppM, design_flow_manager.lock(), parameters));
}
#if HAVE_TASTE
case CREATE_ADDRESS_TRANSLATION:
{
return DesignFlowStepRef(new CreateAddressTranslation(AppM, design_flow_manager.lock(), parameters));
}
#endif
case(CREATE_TREE_MANAGER):
{
return DesignFlowStepRef(new create_tree_manager(parameters, AppM, design_flow_manager.lock()));
}
case DEAD_CODE_ELIMINATION_IPA:
{
return DesignFlowStepRef(new dead_code_eliminationIPA(AppM, design_flow_manager.lock(), parameters));
}
case FIND_MAX_TRANSFORMATIONS:
{
return DesignFlowStepRef(new FindMaxTransformations(AppM, design_flow_manager.lock(), parameters));
}
case(FUNCTION_ANALYSIS):
{
return DesignFlowStepRef(new call_graph_computation(parameters, AppM, design_flow_manager.lock()));
}
case HDL_FUNCTION_DECL_FIX:
{
return DesignFlowStepRef(new HDLFunctionDeclFix(AppM, design_flow_manager.lock(), parameters));
}
#if HAVE_HOST_PROFILING_BUILT
case(HOST_PROFILING):
{
return DesignFlowStepRef(new HostProfiling(AppM, design_flow_manager.lock(), parameters));
}
#endif
#if HAVE_PRAGMA_BUILT
case PRAGMA_ANALYSIS:
{
return DesignFlowStepRef(new PragmaAnalysis(AppM, design_flow_manager.lock(), parameters));
}
#endif
#if HAVE_FROM_PRAGMA_BUILT
case(PRAGMA_SUBSTITUTION):
{
return DesignFlowStepRef(new PragmaSubstitution(AppM, design_flow_manager.lock(), parameters));
}
#endif
case RANGE_ANALYSIS:
{
return DesignFlowStepRef(new RangeAnalysis(AppM, design_flow_manager.lock(), parameters));
}
case STRING_CST_FIX:
{
return DesignFlowStepRef(new string_cst_fix(AppM, design_flow_manager.lock(), parameters));
}
case ADD_BB_ECFG_EDGES:
case ADD_ARTIFICIAL_CALL_FLOW_EDGES:
case ADD_OP_EXIT_FLOW_EDGES:
case ADD_OP_LOOP_FLOW_EDGES:
case ADD_OP_PHI_FLOW_EDGES:
case BASIC_BLOCKS_CFG_COMPUTATION:
case BB_CONTROL_DEPENDENCE_COMPUTATION:
case BB_FEEDBACK_EDGES_IDENTIFICATION:
case BB_ORDER_COMPUTATION:
case BB_REACHABILITY_COMPUTATION:
case BIT_VALUE:
case BIT_VALUE_OPT:
case BITVALUE_RANGE:
case BLOCK_FIX:
case BUILD_VIRTUAL_PHI:
case CALL_EXPR_FIX:
case CALL_GRAPH_BUILTIN_CALL:
case CHECK_SYSTEM_TYPE:
case COMPLETE_BB_GRAPH:
case COMPUTE_IMPLICIT_CALLS:
case COMMUTATIVE_EXPR_RESTRUCTURING:
case COND_EXPR_RESTRUCTURING:
case CSE_STEP:
case DATAFLOW_CG_EXT:
case DEAD_CODE_ELIMINATION:
case DETERMINE_MEMORY_ACCESSES:
case DOM_POST_DOM_COMPUTATION:
case ESSA:
case(FANOUT_OPT):
case MULTIPLE_ENTRY_IF_REDUCTION:
case EXTRACT_GIMPLE_COND_OP:
#if HAVE_FROM_PRAGMA_BUILT
case EXTRACT_OMP_ATOMIC:
case EXTRACT_OMP_FOR:
#endif
case EXTRACT_PATTERNS:
case FUNCTION_CALL_TYPE_CLEANUP:
case FUNCTION_CALL_OPT:
case FIX_STRUCTS_PASSED_BY_VALUE:
case FIX_VDEF:
case HDL_VAR_DECL_FIX:
case HLS_DIV_CG_EXT:
case HWCALL_INJECTION:
case IR_LOWERING:
case LOOP_COMPUTATION:
case LOOPS_ANALYSIS_BAMBU:
case LOOPS_COMPUTATION:
case LUT_TRANSFORMATION:
case MULTI_WAY_IF:
case NI_SSA_LIVENESS:
case OP_CONTROL_DEPENDENCE_COMPUTATION:
case OP_FEEDBACK_EDGES_IDENTIFICATION:
case OP_ORDER_COMPUTATION:
case OP_REACHABILITY_COMPUTATION:
case OPERATIONS_CFG_COMPUTATION:
case PARM2SSA:
case PARM_DECL_TAKEN_ADDRESS:
case PHI_OPT:
case PREDICATE_STATEMENTS:
case REBUILD_INITIALIZATION:
case REBUILD_INITIALIZATION2:
case REMOVE_CLOBBER_GA:
case REMOVE_ENDING_IF:
#if HAVE_ILP_BUILT
case SDC_CODE_MOTION:
#endif
case SERIALIZE_MUTUAL_EXCLUSIONS:
case SPLIT_RETURN:
case SHORT_CIRCUIT_TAF:
case SIMPLE_CODE_MOTION:
case SOFT_FLOAT_CG_EXT:
case SCALAR_SSA_DATA_FLOW_ANALYSIS:
case SWITCH_FIX:
case UN_COMPARISON_LOWERING:
case UNROLLING_DEGREE:
#if HAVE_ILP_BUILT
case UPDATE_SCHEDULE:
#endif
case USE_COUNTING:
case VAR_ANALYSIS:
case VAR_DECL_FIX:
case VECTORIZE:
case VERIFICATION_OPERATION:
case VIRTUAL_AGGREGATE_DATA_FLOW_ANALYSIS:
case VIRTUAL_PHI_NODES_SPLIT:
{
THROW_UNREACHABLE("Trying to create an application flow step from " +
FrontendFlowStep::EnumToKindText(design_flow_step_type));
break;
}
case SYMBOLIC_APPLICATION_FRONTEND_FLOW_STEP:
{
THROW_UNREACHABLE("Symbolic Application Frontend Flow Step must be created by GenerateFrontendSteps");
break;
}
default:
THROW_UNREACHABLE("Frontend flow step type does not exist");
}
return DesignFlowStepRef();
}
const DesignFlowStepRef
FrontendFlowStepFactory::CreateFunctionFrontendFlowStep(const FrontendFlowStepType design_flow_step_type,
const unsigned int function_id) const
{
switch(design_flow_step_type)
{
case ADD_BB_ECFG_EDGES:
{
return DesignFlowStepRef(new AddBbEcfgEdges(AppM, function_id, design_flow_manager.lock(), parameters));
}
case ADD_ARTIFICIAL_CALL_FLOW_EDGES:
{
return DesignFlowStepRef(
new AddArtificialCallFlowEdges(AppM, function_id, design_flow_manager.lock(), parameters));
}
case ADD_OP_EXIT_FLOW_EDGES:
{
return DesignFlowStepRef(new AddOpExitFlowEdges(parameters, AppM, function_id, design_flow_manager.lock()));
}
case ADD_OP_LOOP_FLOW_EDGES:
{
return DesignFlowStepRef(new AddOpLoopFlowEdges(parameters, AppM, function_id, design_flow_manager.lock()));
}
case ADD_OP_PHI_FLOW_EDGES:
{
return DesignFlowStepRef(new AddOpPhiFlowEdges(AppM, function_id, design_flow_manager.lock(), parameters));
}
case BASIC_BLOCKS_CFG_COMPUTATION:
{
return DesignFlowStepRef(
new BasicBlocksCfgComputation(parameters, AppM, function_id, design_flow_manager.lock()));
}
case BB_CONTROL_DEPENDENCE_COMPUTATION:
{
return DesignFlowStepRef(new BBCdgComputation(parameters, AppM, function_id, design_flow_manager.lock()));
}
case BB_FEEDBACK_EDGES_IDENTIFICATION:
{
return DesignFlowStepRef(
new bb_feedback_edges_computation(parameters, AppM, function_id, design_flow_manager.lock()));
}
case BB_ORDER_COMPUTATION:
{
return DesignFlowStepRef(new BBOrderComputation(parameters, AppM, function_id, design_flow_manager.lock()));
}
case BB_REACHABILITY_COMPUTATION:
{
return DesignFlowStepRef(
new BBReachabilityComputation(parameters, AppM, function_id, design_flow_manager.lock()));
}
case BIT_VALUE:
{
return DesignFlowStepRef(new Bit_Value(parameters, AppM, function_id, design_flow_manager.lock()));
}
case BIT_VALUE_OPT:
{
return DesignFlowStepRef(new Bit_Value_opt(parameters, AppM, function_id, design_flow_manager.lock()));
}
case BITVALUE_RANGE:
{
return DesignFlowStepRef(new BitValueRange(parameters, AppM, function_id, design_flow_manager.lock()));
}
case BLOCK_FIX:
{
return DesignFlowStepRef(new BlockFix(AppM, function_id, design_flow_manager.lock(), parameters));
}
case BUILD_VIRTUAL_PHI:
{
return DesignFlowStepRef(new BuildVirtualPhi(AppM, function_id, design_flow_manager.lock(), parameters));
}
case CALL_EXPR_FIX:
{
return DesignFlowStepRef(new call_expr_fix(AppM, function_id, design_flow_manager.lock(), parameters));
}
case CALL_GRAPH_BUILTIN_CALL:
{
return DesignFlowStepRef(new CallGraphBuiltinCall(AppM, function_id, design_flow_manager.lock(), parameters));
}
case CHECK_SYSTEM_TYPE:
{
return DesignFlowStepRef(new CheckSystemType(parameters, AppM, function_id, design_flow_manager.lock()));
}
case COMPLETE_BB_GRAPH:
{
return DesignFlowStepRef(new CompleteBBGraph(AppM, function_id, design_flow_manager.lock(), parameters));
}
case COMPUTE_IMPLICIT_CALLS:
{
return DesignFlowStepRef(
new compute_implicit_calls(parameters, AppM, function_id, design_flow_manager.lock()));
}
case COMMUTATIVE_EXPR_RESTRUCTURING:
{
return DesignFlowStepRef(
new commutative_expr_restructuring(AppM, function_id, design_flow_manager.lock(), parameters));
}
case COND_EXPR_RESTRUCTURING:
{
return DesignFlowStepRef(new CondExprRestructuring(AppM, function_id, design_flow_manager.lock(), parameters));
}
case CSE_STEP:
{
return DesignFlowStepRef(new CSE(parameters, AppM, function_id, design_flow_manager.lock()));
}
case DATAFLOW_CG_EXT:
{
return DesignFlowStepRef(new dataflow_cg_ext(parameters, AppM, function_id, design_flow_manager.lock()));
}
case DEAD_CODE_ELIMINATION:
{
return DesignFlowStepRef(new dead_code_elimination(parameters, AppM, function_id, design_flow_manager.lock()));
}
case DETERMINE_MEMORY_ACCESSES:
{
return DesignFlowStepRef(
new determine_memory_accesses(parameters, AppM, function_id, design_flow_manager.lock()));
}
case DOM_POST_DOM_COMPUTATION:
{
return DesignFlowStepRef(
new dom_post_dom_computation(parameters, AppM, function_id, design_flow_manager.lock()));
}
case(ESSA):
{
return DesignFlowStepRef(new eSSA(parameters, AppM, function_id, design_flow_manager.lock()));
}
case(FANOUT_OPT):
{
return DesignFlowStepRef(new fanout_opt(parameters, AppM, function_id, design_flow_manager.lock()));
}
case(MULTIPLE_ENTRY_IF_REDUCTION):
{
return DesignFlowStepRef(
new MultipleEntryIfReduction(parameters, AppM, function_id, design_flow_manager.lock()));
}
case EXTRACT_GIMPLE_COND_OP:
{
return DesignFlowStepRef(new ExtractGimpleCondOp(AppM, design_flow_manager.lock(), function_id, parameters));
}
#if HAVE_FROM_PRAGMA_BUILT
case EXTRACT_OMP_ATOMIC:
{
return DesignFlowStepRef(new ExtractOmpAtomic(AppM, function_id, design_flow_manager.lock(), parameters));
}
case EXTRACT_OMP_FOR:
{
return DesignFlowStepRef(new ExtractOmpFor(AppM, function_id, design_flow_manager.lock(), parameters));
}
#endif
case EXTRACT_PATTERNS:
{
return DesignFlowStepRef(new extract_patterns(parameters, AppM, function_id, design_flow_manager.lock()));
}
case FIX_STRUCTS_PASSED_BY_VALUE:
{
return DesignFlowStepRef(
new FixStructsPassedByValue(parameters, AppM, function_id, design_flow_manager.lock()));
}
case FIX_VDEF:
{
return DesignFlowStepRef(new FixVdef(parameters, AppM, function_id, design_flow_manager.lock()));
}
case FUNCTION_CALL_TYPE_CLEANUP:
{
return DesignFlowStepRef(
new FunctionCallTypeCleanup(parameters, AppM, function_id, design_flow_manager.lock()));
}
case FUNCTION_CALL_OPT:
{
return DesignFlowStepRef(new FunctionCallOpt(parameters, AppM, function_id, design_flow_manager.lock()));
}
case HDL_VAR_DECL_FIX:
{
return DesignFlowStepRef(new HDLVarDeclFix(AppM, function_id, design_flow_manager.lock(), parameters));
}
case HLS_DIV_CG_EXT:
{
return DesignFlowStepRef(new hls_div_cg_ext(parameters, AppM, function_id, design_flow_manager.lock()));
}
case HWCALL_INJECTION:
{
return DesignFlowStepRef(new HWCallInjection(parameters, AppM, function_id, design_flow_manager.lock()));
}
case IR_LOWERING:
{
return DesignFlowStepRef(new IR_lowering(parameters, AppM, function_id, design_flow_manager.lock()));
}
case LOOP_COMPUTATION:
{
return DesignFlowStepRef(new loops_computation(parameters, AppM, function_id, design_flow_manager.lock()));
}
case LOOPS_ANALYSIS_BAMBU:
{
return DesignFlowStepRef(new LoopsAnalysisBambu(parameters, AppM, function_id, design_flow_manager.lock()));
}
case LOOPS_COMPUTATION:
{
return DesignFlowStepRef(new loops_computation(parameters, AppM, function_id, design_flow_manager.lock()));
}
case LUT_TRANSFORMATION:
{
return DesignFlowStepRef(new lut_transformation(parameters, AppM, function_id, design_flow_manager.lock()));
}
case MULTI_WAY_IF:
{
return DesignFlowStepRef(new multi_way_if(parameters, AppM, function_id, design_flow_manager.lock()));
}
case NI_SSA_LIVENESS:
{
return DesignFlowStepRef(new NI_SSA_liveness(parameters, AppM, function_id, design_flow_manager.lock()));
}
case OP_CONTROL_DEPENDENCE_COMPUTATION:
{
return DesignFlowStepRef(new OpCdgComputation(parameters, AppM, function_id, design_flow_manager.lock()));
}
case OP_FEEDBACK_EDGES_IDENTIFICATION:
{
return DesignFlowStepRef(
new op_feedback_edges_computation(parameters, AppM, function_id, design_flow_manager.lock()));
}
case OP_ORDER_COMPUTATION:
{
return DesignFlowStepRef(new OpOrderComputation(parameters, AppM, function_id, design_flow_manager.lock()));
}
case OP_REACHABILITY_COMPUTATION:
{
return DesignFlowStepRef(
new OpReachabilityComputation(parameters, AppM, function_id, design_flow_manager.lock()));
}
case OPERATIONS_CFG_COMPUTATION:
{
return DesignFlowStepRef(
new operations_cfg_computation(parameters, AppM, function_id, design_flow_manager.lock()));
}
case PARM2SSA:
{
return DesignFlowStepRef(new parm2ssa(parameters, AppM, function_id, design_flow_manager.lock()));
}
case PARM_DECL_TAKEN_ADDRESS:
{
return DesignFlowStepRef(
new parm_decl_taken_address_fix(parameters, AppM, function_id, design_flow_manager.lock()));
}
case PHI_OPT:
{
return DesignFlowStepRef(new PhiOpt(AppM, function_id, design_flow_manager.lock(), parameters));
}
case PREDICATE_STATEMENTS:
{
return DesignFlowStepRef(new PredicateStatements(AppM, function_id, design_flow_manager.lock(), parameters));
}
case REBUILD_INITIALIZATION:
{
return DesignFlowStepRef(
new rebuild_initialization(parameters, AppM, function_id, design_flow_manager.lock()));
}
case REBUILD_INITIALIZATION2:
{
return DesignFlowStepRef(
new rebuild_initialization2(parameters, AppM, function_id, design_flow_manager.lock()));
}
case REMOVE_CLOBBER_GA:
{
return DesignFlowStepRef(new remove_clobber_ga(AppM, function_id, design_flow_manager.lock(), parameters));
}
case REMOVE_ENDING_IF:
{
return DesignFlowStepRef(new RemoveEndingIf(parameters, AppM, function_id, design_flow_manager.lock()));
}
#if HAVE_ILP_BUILT
case SDC_CODE_MOTION:
{
return DesignFlowStepRef(new SDCCodeMotion(AppM, function_id, design_flow_manager.lock(), parameters));
}
#endif
case SERIALIZE_MUTUAL_EXCLUSIONS:
{
return DesignFlowStepRef(
new SerializeMutualExclusions(AppM, function_id, design_flow_manager.lock(), parameters));
}
case SPLIT_RETURN:
{
return DesignFlowStepRef(new SplitReturn(parameters, AppM, function_id, design_flow_manager.lock()));
}
case SHORT_CIRCUIT_TAF:
{
return DesignFlowStepRef(new short_circuit_taf(parameters, AppM, function_id, design_flow_manager.lock()));
}
case SIMPLE_CODE_MOTION:
{
return DesignFlowStepRef(new simple_code_motion(parameters, AppM, function_id, design_flow_manager.lock()));
}
case SOFT_FLOAT_CG_EXT:
{
return DesignFlowStepRef(new soft_float_cg_ext(parameters, AppM, function_id, design_flow_manager.lock()));
}
case SCALAR_SSA_DATA_FLOW_ANALYSIS:
{
return DesignFlowStepRef(
new ScalarSsaDataDependenceComputation(parameters, AppM, function_id, design_flow_manager.lock()));
}
case SWITCH_FIX:
{
return DesignFlowStepRef(new SwitchFix(AppM, function_id, design_flow_manager.lock(), parameters));
}
case UN_COMPARISON_LOWERING:
{
return DesignFlowStepRef(new UnComparisonLowering(AppM, function_id, design_flow_manager.lock(), parameters));
}
case UNROLLING_DEGREE:
{
THROW_UNREACHABLE("Not updated step");
break;
}
#if HAVE_ILP_BUILT
case UPDATE_SCHEDULE:
{
return DesignFlowStepRef(new UpdateSchedule(AppM, function_id, design_flow_manager.lock(), parameters));
}
#endif
case USE_COUNTING:
{
return DesignFlowStepRef(new use_counting(parameters, AppM, function_id, design_flow_manager.lock()));
}
case VAR_ANALYSIS:
{
return DesignFlowStepRef(new VarComputation(parameters, AppM, function_id, design_flow_manager.lock()));
}
case VAR_DECL_FIX:
{
return DesignFlowStepRef(new VarDeclFix(AppM, function_id, design_flow_manager.lock(), parameters));
}
case VECTORIZE:
{
return DesignFlowStepRef(new Vectorize(AppM, function_id, design_flow_manager.lock(), parameters));
}
case VERIFICATION_OPERATION:
{
THROW_UNREACHABLE("Not updated step");
break;
}
case VIRTUAL_AGGREGATE_DATA_FLOW_ANALYSIS:
{
return DesignFlowStepRef(
new VirtualAggregateDataFlowAnalysis(AppM, design_flow_manager.lock(), function_id, parameters));
}
case VIRTUAL_PHI_NODES_SPLIT:
{
return DesignFlowStepRef(
new virtual_phi_nodes_split(parameters, AppM, function_id, design_flow_manager.lock()));
}
#if HAVE_HOST_PROFILING_BUILT
case BASIC_BLOCKS_PROFILING:
#endif
case BAMBU_FRONTEND_FLOW:
case BIT_VALUE_IPA:
case INTERFACE_INFER:
case(COMPLETE_CALL_GRAPH):
#if HAVE_TASTE
case CREATE_ADDRESS_TRANSLATION:
#endif
case(CREATE_TREE_MANAGER):
case DEAD_CODE_ELIMINATION_IPA:
case FIND_MAX_TRANSFORMATIONS:
case(FUNCTION_ANALYSIS):
case HDL_FUNCTION_DECL_FIX:
#if HAVE_HOST_PROFILING_BUILT
case(HOST_PROFILING):
#endif
#if HAVE_PRAGMA_BUILT
case(PRAGMA_ANALYSIS):
#endif
#if HAVE_FROM_PRAGMA_BUILT
case(PRAGMA_SUBSTITUTION):
#endif
case RANGE_ANALYSIS:
case STRING_CST_FIX:
case(SYMBOLIC_APPLICATION_FRONTEND_FLOW_STEP):
{
THROW_UNREACHABLE("Trying to create a function frontend flow step from " +
FrontendFlowStep::EnumToKindText(design_flow_step_type));
break;
}
default:
THROW_UNREACHABLE("Frontend flow step type does not exist");
}
return DesignFlowStepRef();
}
const std::string FrontendFlowStepFactory::GetPrefix() const
{
return "Frontend";
}