PandA-2024.02
ext_tree_node.hpp
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 #ifndef EXT_TREE_NODE_HPP
47 #define EXT_TREE_NODE_HPP
48 
49 #include "custom_map.hpp" // for unordered_map
50 #include "tree_common.hpp" // for GET_KIND, blackbox_pragma_K, call_hw_prag...
51 #include "tree_node.hpp"
52 #include <list> // for list
53 #include <string> // for string
54 #include <utility> // for pair
55 
56 struct null_node : public tree_node
57 {
59  explicit null_node(unsigned int i) : tree_node(i)
60  {
61  }
62 
65 
66 
68 
69 
73  void visit(tree_node_visitor* const v) const override;
74 
76  enum
77  {
79  };
80 };
81 
82 struct gimple_pragma : public gimple_node
83 {
85  explicit gimple_pragma(unsigned int i) : gimple_node(i), is_block(false), is_opening(true)
86  {
87  }
88 
90  bool is_block;
91 
93  bool is_opening;
94 
97 
100 
102  std::string line;
103 
106 
107 
109 
110 
114  void visit(tree_node_visitor* const v) const override;
115 
117  enum
118  {
120  GETID(scope),
121  GETID(directive)
122  };
123 };
124 
126 {
128  explicit profiling_pragma(unsigned int i) : tree_node(i)
129  {
130  }
131 
134 
135 
137 
138 
142  void visit(tree_node_visitor* const v) const override;
143 
145  enum
146  {
148  };
149 };
150 
152 {
154  explicit statistical_profiling(unsigned int i) : profiling_pragma(i)
155  {
156  }
157 
160 
161 
163 
164 
168  void visit(tree_node_visitor* const v) const override;
169 
171  enum
172  {
174  };
175 };
176 
177 struct map_pragma : public tree_node
178 {
180  explicit map_pragma(unsigned int i) : tree_node(i)
181  {
182  }
183 
186 
187 
189 
190 
194  void visit(tree_node_visitor* const v) const override;
195 
197  enum
198  {
200  };
201 };
202 
206 struct call_hw_pragma : public map_pragma
207 {
209  explicit call_hw_pragma(unsigned int i) : map_pragma(i)
210  {
211  }
212 
214  std::string HW_component;
215 
217  std::string ID_implementation;
218 
221 
222 
224 
225 
229  void visit(tree_node_visitor* const v) const override;
230 
232  enum
233  {
235  };
236 };
237 
242 {
244  explicit call_point_hw_pragma(unsigned int i) : map_pragma(i), recursive(false)
245  {
246  }
247 
249  std::string HW_component;
250 
252  std::string ID_implementation;
253 
255  bool recursive;
256 
259 
260 
262 
263 
267  void visit(tree_node_visitor* const v) const override;
268 
270  enum
271  {
273  };
274 };
275 
276 struct issue_pragma : public tree_node
277 {
279  explicit issue_pragma(unsigned int i) : tree_node(i)
280  {
281  }
282 
285 
286 
288 
289 
293  void visit(tree_node_visitor* const v) const override;
294 
296  enum
297  {
299  };
300 };
301 
303 {
305  explicit blackbox_pragma(unsigned int i) : issue_pragma(i)
306  {
307  }
308 
311 
312 
314 
315 
319  void visit(tree_node_visitor* const v) const override;
320 
322  enum
323  {
325  };
326 };
327 
328 struct omp_pragma : public tree_node
329 {
331  explicit omp_pragma(unsigned int i) : tree_node(i)
332  {
333  }
334 
337 
338 
340 
341 
345  void visit(tree_node_visitor* const v) const override;
346 
348  enum
349  {
351  };
352 };
353 
355 {
357  explicit omp_parallel_pragma(unsigned int i) : omp_pragma(i), is_shortcut(false)
358  {
359  }
360 
364 
367 
370 
371 
373 
374 
378  void visit(tree_node_visitor* const v) const override;
379 
381  enum
382  {
384  };
385 };
386 
388 {
390  explicit omp_sections_pragma(unsigned int i) : omp_pragma(i), is_shortcut(false)
391  {
392  }
393 
396 
399 
400 
402 
403 
407  void visit(tree_node_visitor* const v) const override;
408 
410  enum
411  {
413  };
414 };
415 
417 {
419  explicit omp_parallel_sections_pragma(unsigned int i) : omp_pragma(i)
420  {
421  }
422 
425 
428 
431 
432 
434 
435 
439  void visit(tree_node_visitor* const v) const override;
440 
442  enum
443  {
445  GETID(op0),
446  GETID(op1)
447  };
448 };
449 
451 {
453  explicit omp_section_pragma(unsigned int i) : omp_pragma(i)
454  {
455  }
456 
459 
460 
462 
463 
467  void visit(tree_node_visitor* const v) const override;
468 
470  enum
471  {
473  };
474 };
475 
477 {
480 
482  explicit omp_target_pragma(unsigned int i);
483 
486 
487 
489 
490 
494  void visit(tree_node_visitor* const v) const override;
495 
497  enum
498  {
500  };
501 };
502 
504 {
507 
509  explicit omp_task_pragma(unsigned int i);
510 
513 
514 
516 
517 
521  void visit(tree_node_visitor* const v) const override;
522 
524  enum
525  {
527  };
528 };
529 
531 {
534 
536  explicit omp_critical_pragma(unsigned int i);
537 
540 
541 
543 
544 
548  void visit(tree_node_visitor* const v) const override;
549 
551  enum
552  {
554  };
555 };
556 
558 {
560  explicit omp_atomic_pragma(unsigned int i) : omp_pragma(i)
561  {
562  }
563 
566 
567 
569 
570 
574  void visit(tree_node_visitor* const v) const override;
575 
577  enum
578  {
580  };
581 };
582 
583 struct omp_for_pragma : public omp_pragma
584 {
586  explicit omp_for_pragma(unsigned int i) : omp_pragma(i)
587  {
588  }
589 
593 
596 
597 
599 
600 
604  void visit(tree_node_visitor* const v) const override;
605 
607  enum
608  {
610  };
611 };
612 
614 {
616  explicit omp_simd_pragma(unsigned int i) : omp_pragma(i)
617  {
618  }
619 
623 
626 
627 
629 
630 
634  void visit(tree_node_visitor* const v) const override;
635 
637  enum
638  {
640  };
641 };
642 
644 {
646  explicit omp_declare_simd_pragma(unsigned int i) : omp_pragma(i)
647  {
648  }
649 
653 
656 
657 
659 
660 
664  void visit(tree_node_visitor* const v) const override;
665 
667  enum
668  {
670  };
671 };
672 
677 struct gimple_while : public gimple_node
678 {
680  explicit gimple_while(unsigned int i) : gimple_node(i)
681  {
682  }
683 
686 
689 
690 
692 
693 
697  void visit(tree_node_visitor* const v) const override;
698 
700  enum
701  {
703  GETID(op0)
704  };
705 };
706 
711 struct gimple_for : public gimple_while
712 {
714  explicit gimple_for(unsigned int i) : gimple_while(i)
715  {
716  }
717 
720 
723 
726 
729 
730 
732 
733 
737  void visit(tree_node_visitor* const v) const override;
738 
740  enum
741  {
743  GETID(op1),
744  GETID(op2)
745  };
746 };
747 
752 {
754  explicit gimple_multi_way_if(unsigned int i) : gimple_node(i)
755  {
756  }
757 
759  std::list<std::pair<tree_nodeRef, unsigned int>> list_of_cond;
760 
766  void add_cond(const tree_nodeRef& cond, unsigned int bb_ind);
767 
770 
771 
773 
774 
778  void visit(tree_node_visitor* const v) const override;
779 
781  enum
782  {
784  GETID(list_of_cond)
785  };
786 };
787 
788 #endif
CustomUnorderedMapUnstable< std::string, std::string > clauses
map between the clauses that can be associated with the OpenMP parallel pragma and their value (e...
bool recursive
True if this mapping pragma has to be considered recursive.
CustomUnorderedMapUnstable< std::string, std::string > clauses
map between the clauses that can be associated with the OpenMP parallel pragma and their value (e...
bool is_shortcut
flag to check if this pragma is shortcut with a OpenMP sections pragma
omp_for_pragma(unsigned int i)
constructor
bool is_shortcut
flag to check if this pragma is shortcut with a OpenMP parallel pragma
omp_parallel_sections_pragma(unsigned int i)
constructor
gimple_while(unsigned int i)
constructor
omp_parallel_pragma(unsigned int i)
constructor
call_point_hw_pragma(unsigned int i)
constructor
statistical_profiling(unsigned int i)
constructor
std::string ID_implementation
The identifier of the implementation.
absl::flat_hash_map< T, U, Hash, Eq, Alloc > CustomUnorderedMapUnstable
Definition: custom_map.hpp:156
redefinition of map to manage ordered/unordered structures
Abstract pure class for the tree structure.
Definition: tree_node.hpp:139
null_node(unsigned int i)
constructor
Directive represinting mapping of a software function on a component.
std::string HW_component
The name of the component.
CustomUnorderedMapUnstable< std::string, std::string > clauses
map between the clauses that can be associated with the OpenMP parallel pragma and their value (e...
tree_nodeRef omp_for
omp pragma for
omp_atomic_pragma(unsigned int i)
constructor
#define GET_KIND(meth)
Macro which define a function that return the parameter as a enum kind.
bool is_block
attribute for pragma: true when the pragma refers to a block
This C++ header file contains common macros for the tree structure.
call_hw_pragma(unsigned int i)
constructor
#define GET_KIND_TEXT(meth)
Macro which defines the get_kind_text function that returns the parameter as a string.
Definition: tree_node.hpp:87
Directive represinting mapping of a function call on a component.
gimple_multi_way_if(unsigned int i)
constructor
std::string HW_component
The name of the component.
CustomUnorderedMapUnstable< std::string, std::string > clauses
Clauses associated with the directives.
bool is_opening
attribute for pragma: true when the pragma refers to an opening pragma
std::string line
this is the string-based form of the pragma
gimple_for(unsigned int i)
constructor
std::list< std::pair< tree_nodeRef, unsigned int > > list_of_cond
The list of pair condition basic block.
Classes specification of the tree_node data structures.
tree_nodeRef op0
The parallel part (the tree_node is a omp_parallel_pragma one)
omp_sections_pragma(unsigned int i)
constructor
gimple_pragma(unsigned int i)
constructor
void visit(tree_node_visitor *const v) const override
Redefinition of get_kind_text.
tree_nodeRef directive
this node represents the directive of the pragma
CustomUnorderedMapUnstable< std::string, std::string > clauses
map between the clauses that can be associated with the OpenMP parallel pragma and their value (e...
omp_declare_simd_pragma(unsigned int i)
constructor
omp_simd_pragma(unsigned int i)
constructor
tree_nodeRef op1
initialization
tree_nodeRef scope
this node defines the scope of the pragma
struct definition of the common part of a gimple with virtual operands
Definition: tree_node.hpp:1078
This struct specifies a multi-way-if construct.
std::string ID_implementation
The identifier of the implementation.
tree_nodeRef op1
The sections part (the tree_node is a omp_sections_pragma one)
omp_pragma(unsigned int i)
constructor
This struct specifies the for expression Used to represent a for construct.
blackbox_pragma(unsigned int i)
constructor
tree_nodeRef op2
postincrement
omp_section_pragma(unsigned int i)
constructor
map_pragma(unsigned int i)
constructor
profiling_pragma(unsigned int i)
constructor
tree_nodeRef op0
The boolean condition.
CustomUnorderedMapUnstable< std::string, std::string > clauses
Clauses associated with the directives.
CustomUnorderedMapUnstable< std::string, std::string > clauses
Clauses associated with the directives.
issue_pragma(unsigned int i)
constructor
This struct specifies the while expression Used to represent a while construct.

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