00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef __info_node_H
00031 #define __info_node_H
00032
00033 #include "instructions_types.h"
00034 #include <string>
00039 using namespace std;
00040 namespace DDG{
00041 class INFO_NODE;
00042 class INFO_EDGE;
00043 class DAG;
00044 class LOOP;
00045
00051 typedef enum {
00052 NodeFlag_Nothing = 0x0,
00053 NodeFlag_PartialDef = 0x1,
00054 NodeFlag_SpillCode = 0x2,
00055 NodeFlag_Volatile = 0x4,
00056 NodeFlag_SPUpdate = 0x8,
00057 NodeFlag_Prefetch = 0x10,
00058 NodeFlag_Preload = 0x20,
00059 NodeFlag_Barrier = 0x40,
00060 NodeFlag_Clobber = 0x80,
00061 NodeFlag_Hoisted = 0x100,
00062 NodeFlag_DeadCode = 0x200,
00063 NodeFlag_SafeAccess = 0x800,
00064 NodeFlag_SafePerfs = 0x1000,
00065 NodeFlag_EntryCode = 0x4000,
00066 NodeFlag_ExitCode = 0x8000,
00067 NodeFlag_KillOp = 0x5000,
00068 } NodeFlag;
00069
00070
00083 class INFO_NODE {
00084 friend class DDG::DAG;
00085 friend class DDG::LOOP;
00086
00087 int identifier;
00088 std::string text;
00089 INSTRUCTIONS_TYPES optype;
00090 NodeFlag node_flag;
00091
00093 void set_id(int id) {identifier=id;}
00094
00095 public:
00101 INFO_NODE() ;
00102
00103
00108 INFO_NODE(int id, INSTRUCTIONS_TYPES opt);
00109
00110 INFO_NODE(const INFO_NODE &in);
00111
00117 INFO_NODE(int id, INSTRUCTIONS_TYPES opt, std::string inst_text);
00118
00120
00124 bool check();
00125
00127 const int id() const
00128 {return identifier;}
00129
00131 const INSTRUCTIONS_TYPES instruction_type() const
00132 {return optype;}
00133
00135 std::string get_string_attribute() const
00136 {return text;}
00139 int instruction_type_id() const
00140 {
00141 return optype.opcode_id();
00142 }
00144 NodeFlag get_node_flag() const
00145 {
00146 return node_flag;
00147 }
00149
00153 void set_instruction_type(INSTRUCTIONS_TYPES opt)
00154 {optype=opt;}
00155
00162 void set_string_attribute(std::string inst_text)
00163 {text=inst_text;}
00165 void set_node_flag ( const NodeFlag theValue )
00166 {
00167 node_flag = theValue;
00168 }
00170
00173 friend ostream& operator<<(ostream &os, INFO_NODE x) ;
00174
00177 friend istream& operator>>(istream &is, INFO_NODE & x);
00178
00179
00180
00182
00183 }
00184 ;
00185
00186 }
00187 #endif