OpenASIP  2.0
Public Types | Public Member Functions | Private Attributes | List of all members
TTAProgram::ProgramAnnotation Class Reference

#include <ProgramAnnotation.hh>

Collaboration diagram for TTAProgram::ProgramAnnotation:
Collaboration graph

Public Types

enum  Id {
  ANN_FIRST_RESERVED = 0x00000000, ANN_LAST_RESERVED = 0x0000FFFF, ANN_STACKFRAME_BEGIN = 0x00011000, ANN_STACKFRAME_LVAR_ALLOC = 0x00011010,
  ANN_STACKFRAME_LVAR_DEALLOC = 0x00011011, ANN_STACKFRAME_LVAR_RA_ALLOC = 0x00011012, ANN_STACKFRAME_LVAR_RA_DEALLOC = 0x00011013, ANN_STACKFRAME_RA_ALLOC = 0x00011020,
  ANN_STACKFRAME_RA_DEALLOC = 0x00011021, ANN_STACKFRAME_RA_SAVE = 0x00011022, ANN_STACKFRAME_RA_RESTORE = 0x00011023, ANN_STACKFRAME_GPR_SAVE_BEGIN = 0x00011030,
  ANN_STACKFRAME_GPR_SAVE = 0x00011031, ANN_STACKFRAME_GPR_SAVE_REG = 0x00011032, ANN_STACKFRAME_GPR_RESTORE_REG = 0x00011038, ANN_STACKFRAME_GPR_RESTORE = 0x00011039,
  ANN_STACKFRAME_FPR_SAVE_BEGIN = 0x00011040, ANN_STACKFRAME_FPR_SAVE = 0x00011041, ANN_STACKFRAME_FPR_SAVE_REG = 0x00011042, ANN_STACKFRAME_FPR_RESTORE_REG = 0x00011048,
  ANN_STACKFRAME_FPR_RESTORE = 0x00011049, ANN_STACKFRAME_OUT_PARAM_ALLOC = 0x00011050, ANN_STACKFRAME_OUT_PARAM_DEALLOC = 0x00011051, ANN_STACKFRAME_PROCEDURE_RETURN = 0x00011060,
  ANN_STACKFRAME_STACK_INIT = 0x00011070, ANN_STACKFRAME_UNKNOWN = 0x00011FFE, ANN_STACKFRAME_END = 0x00011FFF, ANN_STACKUSE_BEGIN = 0x00012000,
  ANN_STACKUSE_OUT_PARAM = 0x00012010, ANN_STACKUSE_LOCAL_VARIABLE = 0x00012011, ANN_STACKUSE_RA = 0x00012012, ANN_STACKUSE_IN_PARAM = 0x00012013,
  ANN_STACKUSE_SAVED_GPR = 0x00012014, ANN_STACKUSE_SAVED_FPR = 0x00012015, ANN_STACKUSE_SPILL = 0x00012016, ANN_STACKUSE_RA_SAVE = 0x00012017,
  ANN_STACKUSE_FP_SAVE = 0x00012018, ANN_STACKUSE_END = 0x00012FFF, ANN_REGISTER_BEGIN = 0x00020000, ANN_REGISTER_RV_SAVE = 0x00020010,
  ANN_REGISTER_RV_READ = 0x00020011, ANN_REGISTER_SP_SAVE = 0x00020020, ANN_REGISTER_SP_READ = 0x00020021, ANN_REGISTER_IPARAM_SAVE = 0x00020030,
  ANN_REGISTER_IPARAM_READ = 0x00020031, ANN_REGISTER_FP_SAVE = 0x00020040, ANN_REGISTER_FP_READ = 0x00020041, ANN_REGISTER_END = 0x0002FFFF,
  ANN_ALLOWED_UNIT_SRC = 0x00030000, ANN_ALLOWED_UNIT_DST = 0x00030001, ANN_CONN_CANDIDATE_UNIT_SRC = 0x00030005, ANN_CONN_CANDIDATE_UNIT_DST = 0x00030006,
  ANN_REJECTED_UNIT_SRC = 0x00030007, ANN_REJECTED_UNIT_DST = 0x00030008, ANN_CONNECTIVITY_MOVE = 0x00030002, ANN_REQUIRES_LIMM = 0x00030003,
  ANN_JUMP_FUNCTION_CALL = 0x00030004, ANN_DEBUG_SOURCE_CODE_PATH = 0x00040000, ANN_DEBUG_SOURCE_CODE_LINE = 0x00040001, ANN_OPENCL_WORK_ITEM_ID = 0x00050000,
  ANN_OPENCL_WORK_ITEM_ID_LAST = 0x00050001, ANN_JUMP_TO_NEXT = 0x00500001, ANN_LOOP_TRIP_COUNT = 0x00600000, ANN_LOOP_INNER,
  ANN_PARALLEL_REGION_ID = 0x00070000, ANN_POINTER_NAME = 0x00700000, ANN_POINTER_OFFSET = 0x00700001, ANN_POINTER_NOALIAS = 0x00700002,
  ANN_POINTER_ADDR_SPACE = 0x00700003, ANN_VECTOR_ID = 0x00800000, ANN_CONSTANT_MEM = 0x00900000, ANN_IRF_FETCH_BLOCK_BEGIN = 0x00A00000,
  ANN_IRF_FETCH_BLOCK_FT = 0x00A00001, ANN_IRF_FETCH_BLOCK_JUMP = 0x00A00002, ANN_IRF_FETCH_BLOCK_CALL = 0x00A00003, ANN_IRF_FETCH_BLOCK_RET = 0x00A00004,
  ANN_IRF_LOCAL_JUMP = 0x00A00005, ANN_IRF_BLOCK_HEADER = 0x00A00010, ANN_IRF_BLOCK_HEADER_NOCACHE = 0x00A00011, ANN_IRF_NOCACHE_BEGIN = 0x00A00020,
  ANN_IRF_BLOCK_FWJUMP_CYCLES = 0x00A00030, ANN_UNDEF_ID = 0xFF000000
}
 the ID in TPEF is 24 bits, here enum More...
 

Public Member Functions

 ProgramAnnotation (Id id, int value)
 
 ProgramAnnotation (Id id, const std::string &data="")
 
 ProgramAnnotation (Id id, const std::vector< Byte > &payload)
 
 ~ProgramAnnotation ()
 
ProgramAnnotation::Id id () const
 
std::string stringValue () const
 
void setStringValue (const std::string &data)
 
int intValue () const
 
void setIntValue (int value)
 
const std::vector< Byte > & payload () const
 

Private Attributes

Id id_
 the id More...
 
std::vector< Bytepayload_
 the payload data More...
 

Detailed Description

ProgramAnnotations provide means for adding arbitrary "annotations" to moves or immediate values in instructions of TTA programs.

This is a POM API to support the corresponding TPEF feature.

Definition at line 49 of file ProgramAnnotation.hh.

Member Enumeration Documentation

◆ Id

the ID in TPEF is 24 bits, here enum

Enumerator
ANN_FIRST_RESERVED 

First reserved annot.

ANN_LAST_RESERVED 

Last reserved annot.

ANN_STACKFRAME_BEGIN 

First stackframe ann.

ANN_STACKFRAME_LVAR_ALLOC 

Local variable alloc.

ANN_STACKFRAME_LVAR_DEALLOC 

Local var dealloc.

ANN_STACKFRAME_LVAR_RA_ALLOC 

Local var+RA alloc.

ANN_STACKFRAME_LVAR_RA_DEALLOC 

Local var+RA dealloc.

ANN_STACKFRAME_RA_ALLOC 

Return Address alloc.

ANN_STACKFRAME_RA_DEALLOC 

Return Addr dealloc.

ANN_STACKFRAME_RA_SAVE 

Return Address save.

ANN_STACKFRAME_RA_RESTORE 

Return Addr restore.

ANN_STACKFRAME_GPR_SAVE_BEGIN 

Used to count saves.

ANN_STACKFRAME_GPR_SAVE 

GPR save by pushing.

ANN_STACKFRAME_GPR_SAVE_REG 
ANN_STACKFRAME_GPR_RESTORE_REG 
ANN_STACKFRAME_GPR_RESTORE 

GPR restore by pop.

ANN_STACKFRAME_FPR_SAVE_BEGIN 

Used to count saves.

ANN_STACKFRAME_FPR_SAVE 

FPR save by pushing.

ANN_STACKFRAME_FPR_SAVE_REG 

FPR save by pushing.

ANN_STACKFRAME_FPR_RESTORE_REG 

FPR restore by pop.

ANN_STACKFRAME_FPR_RESTORE 

FPR restore by pop.

ANN_STACKFRAME_OUT_PARAM_ALLOC 

outgoing param alloc

ANN_STACKFRAME_OUT_PARAM_DEALLOC 

outgoing param deall.

ANN_STACKFRAME_PROCEDURE_RETURN 

precedure return jmp

ANN_STACKFRAME_STACK_INIT 

Stack initialization.

ANN_STACKFRAME_UNKNOWN 

Unknown SF-related.

ANN_STACKFRAME_END 

Last stackfame annot.

ANN_STACKUSE_BEGIN 
ANN_STACKUSE_OUT_PARAM 

output parameter.

ANN_STACKUSE_LOCAL_VARIABLE 

local variable

ANN_STACKUSE_RA 

ra, old frontend

ANN_STACKUSE_IN_PARAM 

input parameter

ANN_STACKUSE_SAVED_GPR 

saved GPR

ANN_STACKUSE_SAVED_FPR 

saved FPR

ANN_STACKUSE_SPILL 

spilled variable

ANN_STACKUSE_RA_SAVE 

ra, new frontend

ANN_STACKUSE_FP_SAVE 

frame ptr save/load

ANN_STACKUSE_END 
ANN_REGISTER_BEGIN 
ANN_REGISTER_RV_SAVE 

Save to RV register.

ANN_REGISTER_RV_READ 

Read from RV reg.

ANN_REGISTER_SP_SAVE 

save to Stack pointer

ANN_REGISTER_SP_READ 

Stack Pointer read.

ANN_REGISTER_IPARAM_SAVE 

Save to int param reg.

ANN_REGISTER_IPARAM_READ 

Read from int param.

ANN_REGISTER_FP_SAVE 

Frame Pointer save.

ANN_REGISTER_FP_READ 

Frame Pointer read.

ANN_REGISTER_END 
ANN_ALLOWED_UNIT_SRC 

Candidate units can be passed for resource manager for choosing the source/destination unit of the move. If this annotation is present, the move's source or destination unit should be chosen from the set given in annotation payload data string. Naturally, there can be multiple annotations of the same type to define multiple candidates for choosing the unit for source/destination.

Src. unit candidate

ANN_ALLOWED_UNIT_DST 

Dst. unit candidate.

ANN_CONN_CANDIDATE_UNIT_SRC 

Src. unit candidate.

ANN_CONN_CANDIDATE_UNIT_DST 

Dst. unit candidate.

ANN_REJECTED_UNIT_SRC 

Src. unit rejected.

ANN_REJECTED_UNIT_DST 

Dst. unit rejected.

ANN_CONNECTIVITY_MOVE 

A reg to reg move that was added because of missing connectivity between the original target and destination (a temp move).

ANN_REQUIRES_LIMM 
ANN_JUMP_FUNCTION_CALL 

The JUMP in the annotated move is a function call and should be treated as such in the data dependency analysis.

ANN_DEBUG_SOURCE_CODE_PATH 

debugging info annotations

Full path to the program source code file the annotated move originates from

ANN_DEBUG_SOURCE_CODE_LINE 

The line number in the source code file the annotated move originates from.

ANN_OPENCL_WORK_ITEM_ID 
ANN_OPENCL_WORK_ITEM_ID_LAST 
ANN_JUMP_TO_NEXT 
ANN_LOOP_TRIP_COUNT 

An instruction annotated with this annotation is the first instruction of a basic block in a loop with the trip count stored in the annotation payload.

ANN_LOOP_INNER 

An instruction annotated with this annotation is the first instruction of a basic block in an inner loop.

ANN_PARALLEL_REGION_ID 

The ID from the _TCEPREGION_START(N) markers.

ANN_POINTER_NAME 

information retrieved (from LLVM) about a pointer access

ANN_POINTER_OFFSET 
ANN_POINTER_NOALIAS 
ANN_POINTER_ADDR_SPACE 
ANN_VECTOR_ID 

Vector indentifier for vector operations.

ANN_CONSTANT_MEM 

Constant memory access.

ANN_IRF_FETCH_BLOCK_BEGIN 

Beginning of a IRF fetch block.

ANN_IRF_FETCH_BLOCK_FT 
ANN_IRF_FETCH_BLOCK_JUMP 
ANN_IRF_FETCH_BLOCK_CALL 
ANN_IRF_FETCH_BLOCK_RET 
ANN_IRF_LOCAL_JUMP 
ANN_IRF_BLOCK_HEADER 

Dummy empty instrution for block header.

ANN_IRF_BLOCK_HEADER_NOCACHE 
ANN_IRF_NOCACHE_BEGIN 

Just to show this starts a non-irf block.

ANN_IRF_BLOCK_FWJUMP_CYCLES 

how many stalls may be needed due forward jumps

ANN_UNDEF_ID 

an illegal annotation ID (the id is only 24 bits, this has more meaningful bits)

Definition at line 52 of file ProgramAnnotation.hh.

52  {
53  ANN_FIRST_RESERVED = 0x00000000, ///<First reserved annot.
54  ANN_LAST_RESERVED = 0x0000FFFF, ///<Last reserved annot.
55  ANN_STACKFRAME_BEGIN = 0x00011000, ///<First stackframe ann.
56  ANN_STACKFRAME_LVAR_ALLOC = 0x00011010, ///<Local variable alloc
57  ANN_STACKFRAME_LVAR_DEALLOC = 0x00011011, ///<Local var dealloc
58  ANN_STACKFRAME_LVAR_RA_ALLOC = 0x00011012, ///<Local var+RA alloc
59  ANN_STACKFRAME_LVAR_RA_DEALLOC = 0x00011013, ///<Local var+RA dealloc
60  ANN_STACKFRAME_RA_ALLOC = 0x00011020, ///<Return Address alloc
61  ANN_STACKFRAME_RA_DEALLOC = 0x00011021, ///<Return Addr dealloc
62  ANN_STACKFRAME_RA_SAVE = 0x00011022, ///<Return Address save
63  ANN_STACKFRAME_RA_RESTORE = 0x00011023, ///<Return Addr restore
64  ANN_STACKFRAME_GPR_SAVE_BEGIN = 0x00011030, ///<Used to count saves
65  ANN_STACKFRAME_GPR_SAVE = 0x00011031, ///<GPR save by pushing
66  ANN_STACKFRAME_GPR_SAVE_REG = 0x00011032,
67  ANN_STACKFRAME_GPR_RESTORE_REG = 0x00011038,
68  ANN_STACKFRAME_GPR_RESTORE = 0x00011039, ///<GPR restore by pop
69  ANN_STACKFRAME_FPR_SAVE_BEGIN = 0x00011040, ///<Used to count saves
70  ANN_STACKFRAME_FPR_SAVE = 0x00011041, ///<FPR save by pushing
71  ANN_STACKFRAME_FPR_SAVE_REG = 0x00011042, ///<FPR save by pushing
72  ANN_STACKFRAME_FPR_RESTORE_REG = 0x00011048, ///<FPR restore by pop
73  ANN_STACKFRAME_FPR_RESTORE = 0x00011049, ///<FPR restore by pop
74  ANN_STACKFRAME_OUT_PARAM_ALLOC = 0x00011050, ///<outgoing param alloc
75  ANN_STACKFRAME_OUT_PARAM_DEALLOC= 0x00011051, ///<outgoing param deall.
76  ANN_STACKFRAME_PROCEDURE_RETURN = 0x00011060, ///<precedure return jmp
77 
78  ANN_STACKFRAME_STACK_INIT = 0x00011070, ///<Stack initialization
79  ANN_STACKFRAME_UNKNOWN = 0x00011FFE, ///<Unknown SF-related
80  ANN_STACKFRAME_END = 0x00011FFF, ///<Last stackfame annot.
81 
82  ANN_STACKUSE_BEGIN = 0x00012000,
83  ANN_STACKUSE_OUT_PARAM = 0x00012010,///<output parameter.
84  ANN_STACKUSE_LOCAL_VARIABLE = 0x00012011,///<local variable
85  ANN_STACKUSE_RA = 0x00012012,///<ra, old frontend
86  ANN_STACKUSE_IN_PARAM = 0x00012013,///<input parameter
87  ANN_STACKUSE_SAVED_GPR = 0x00012014,///<saved GPR
88  ANN_STACKUSE_SAVED_FPR = 0x00012015,///<saved FPR
89  ANN_STACKUSE_SPILL = 0x00012016,///<spilled variable
90  ANN_STACKUSE_RA_SAVE = 0x00012017,///<ra, new frontend
91  ANN_STACKUSE_FP_SAVE = 0x00012018,///<frame ptr save/load
92  ANN_STACKUSE_END = 0x00012FFF,
93 
94  ANN_REGISTER_BEGIN = 0x00020000,
95  ANN_REGISTER_RV_SAVE = 0x00020010,///<Save to RV register
96  ANN_REGISTER_RV_READ = 0x00020011,///<Read from RV reg
97  ANN_REGISTER_SP_SAVE = 0x00020020,///<save to Stack pointer
98  ANN_REGISTER_SP_READ = 0x00020021,///<Stack Pointer read
99  ANN_REGISTER_IPARAM_SAVE = 0x00020030,///<Save to int param reg
100  ANN_REGISTER_IPARAM_READ = 0x00020031,///<Read from int param
101  ANN_REGISTER_FP_SAVE = 0x00020040,///<Frame Pointer save
102  ANN_REGISTER_FP_READ = 0x00020041,///<Frame Pointer read
103  ANN_REGISTER_END = 0x0002FFFF,
104 
105  /// Candidate units can be passed for resource manager for
106  /// choosing the source/destination unit of the move. If this
107  /// annotation is present, the move's source or destination unit
108  /// should be chosen from the set given in annotation
109  /// payload data string. Naturally, there can be multiple annotations
110  /// of the same type to define multiple candidates for choosing
111  /// the unit for source/destination.
112  ANN_ALLOWED_UNIT_SRC = 0x00030000,///<Src. unit candidate
113  ANN_ALLOWED_UNIT_DST = 0x00030001,///<Dst. unit candidate
114 
115  ANN_CONN_CANDIDATE_UNIT_SRC = 0x00030005,///<Src. unit candidate
116  ANN_CONN_CANDIDATE_UNIT_DST = 0x00030006,///<Dst. unit candidate
117 
118  ANN_REJECTED_UNIT_SRC = 0x00030007,///<Src. unit rejected
119  ANN_REJECTED_UNIT_DST = 0x00030008,///<Dst. unit rejected
120 
121  /// A reg to reg move that was added because of missing connectivity
122  /// between the original target and destination (a temp move).
123  ANN_CONNECTIVITY_MOVE = 0x00030002,
124 
125  ANN_REQUIRES_LIMM = 0x00030003,
126 
127  /// The JUMP in the annotated move is a function call and should
128  /// be treated as such in the data dependency analysis.
129  ANN_JUMP_FUNCTION_CALL = 0x00030004,
130  /// debugging info annotations
131 
132  /// Full path to the program source code file the annotated move
133  /// originates from
134  ANN_DEBUG_SOURCE_CODE_PATH = 0x00040000,
135 
136  /// The line number in the source code file the annotated move
137  /// originates from
138  ANN_DEBUG_SOURCE_CODE_LINE = 0x00040001,
139 
140 
141  /* Moves with this annotation are from an OpenCL work item at
142  the given local ID "offset". The ID does not necessarily map
143  to real work item local ids, but depends on the work group
144  loop parallelization level ("warp size") etc.
145 
146  The local ID components are stored to the same integer payload
147  to make ID comparisons fast and easy:
148 
149  (z & 0x0FF) | ((y & 0x0FF) << 8) | ((x & 0x0FF) << 16)
150 
151  Thus, the maximum allowed WI "offset" is (255, 255, 255). */
152 
153  ANN_OPENCL_WORK_ITEM_ID = 0x00050000,
154  // In case of vector memory access, the work item id from the
155  // memory access is for the first of the work items in the vector
156  // access. Also the last of the work item ID in the vector access is
157  // necessary.
158  ANN_OPENCL_WORK_ITEM_ID_LAST = 0x00050001,
159 
160  ANN_JUMP_TO_NEXT = 0x00500001,
161 
162  /// An instruction annotated with this annotation is the first
163  /// instruction of a basic block in a loop with the
164  /// trip count stored in the annotation payload.
165  ANN_LOOP_TRIP_COUNT = 0x00600000,
166  /// An instruction annotated with this annotation is the first
167  /// instruction of a basic block in an inner loop.
169 
170  /// The ID from the _TCEPREGION_START(N) markers.
171  ANN_PARALLEL_REGION_ID = 0x00070000,
172 
173  /// information retrieved (from LLVM) about a pointer access
174  ANN_POINTER_NAME = 0x00700000,
175  ANN_POINTER_OFFSET = 0x00700001,
176  ANN_POINTER_NOALIAS = 0x00700002,
177  ANN_POINTER_ADDR_SPACE = 0x00700003,
178 
179  /// Vector indentifier for vector operations
180  ANN_VECTOR_ID = 0x00800000,
181 
182  /// Constant memory access
183  ANN_CONSTANT_MEM = 0x00900000,
184 
185  /// Beginning of a IRF fetch block
186  ANN_IRF_FETCH_BLOCK_BEGIN = 0x00A00000,
187  ANN_IRF_FETCH_BLOCK_FT = 0x00A00001,
188  ANN_IRF_FETCH_BLOCK_JUMP = 0x00A00002,
189  ANN_IRF_FETCH_BLOCK_CALL = 0x00A00003,
190  ANN_IRF_FETCH_BLOCK_RET = 0x00A00004,
191  ANN_IRF_LOCAL_JUMP = 0x00A00005,
192  /// Dummy empty instrution for block header.
193  ANN_IRF_BLOCK_HEADER = 0x00A00010,
194  ANN_IRF_BLOCK_HEADER_NOCACHE = 0x00A00011,
195  /// Just to show this starts a non-irf block
196  ANN_IRF_NOCACHE_BEGIN = 0x00A00020,
197  /// how many stalls may be needed due forward jumps
198  ANN_IRF_BLOCK_FWJUMP_CYCLES = 0x00A00030,
199 
200  /// an illegal annotation ID (the id is only 24 bits, this has more
201  /// meaningful bits)
202  ANN_UNDEF_ID = 0xFF000000
203 
204  };

Constructor & Destructor Documentation

◆ ProgramAnnotation() [1/3]

TTAProgram::ProgramAnnotation::ProgramAnnotation ( Id  id,
int  value 
)

Definition at line 60 of file ProgramAnnotation.cc.

60  :
61  id_(id) {
62  setIntValue(value);
63 }

References setIntValue().

Here is the call graph for this function:

◆ ProgramAnnotation() [2/3]

TTAProgram::ProgramAnnotation::ProgramAnnotation ( Id  id,
const std::string &  data = "" 
)

Constructor.

Note
Exceeding the maximum annotation length of TPEF leads to an assertion!
Parameters
idThe id of the annotation (a 24-bit value).
dataThe payload data as a string.

Definition at line 53 of file ProgramAnnotation.cc.

53  :
54  id_(id) {
55  assert(data.length() <=
57  setStringValue(data);
58 }

References assert, TPEF::InstructionAnnotation::MAX_ANNOTATION_BYTES, and setStringValue().

Here is the call graph for this function:

◆ ProgramAnnotation() [3/3]

TTAProgram::ProgramAnnotation::ProgramAnnotation ( Id  id,
const std::vector< Byte > &  payload 
)

Constructor.

Parameters
idThe id of the annotation (a 24-bit value).
dataThe payload data as a byte vector.

Definition at line 71 of file ProgramAnnotation.cc.

72  :
73  id_(id), payload_(payload) {
74  assert(payload.size() <=
76 }

References assert, TPEF::InstructionAnnotation::MAX_ANNOTATION_BYTES, and payload().

Here is the call graph for this function:

◆ ~ProgramAnnotation()

TTAProgram::ProgramAnnotation::~ProgramAnnotation ( )

Destructor.

Definition at line 81 of file ProgramAnnotation.cc.

81  {
82 }

Member Function Documentation

◆ id()

ProgramAnnotation::Id TTAProgram::ProgramAnnotation::id ( ) const

◆ intValue()

int TTAProgram::ProgramAnnotation::intValue ( ) const

Definition at line 95 of file ProgramAnnotation.cc.

95  {
97 }

References stringValue(), and Conversion::toInt().

Referenced by PRegionAliasAnalyzer::analyze().

Here is the call graph for this function:

◆ payload()

const std::vector< Byte > & TTAProgram::ProgramAnnotation::payload ( ) const

Return the payload data as a non-mutable char vector.

Returns
The payload data.

Definition at line 121 of file ProgramAnnotation.cc.

121  {
122  return payload_;
123 }

References payload_.

Referenced by llvm::LLVMTCEBuilder::copyFUAnnotations(), TTAProgram::ProgramWriter::createCodeSection(), DataDependenceGraph::mergeAndKeepSource(), DataDependenceGraph::mergeAndKeepUser(), BFUpdateMoveOnBypass::operator()(), and ProgramAnnotation().

◆ setIntValue()

void TTAProgram::ProgramAnnotation::setIntValue ( int  value)

Definition at line 100 of file ProgramAnnotation.cc.

100  {
101  std::string data = Conversion::toString(value);
102  payload_ = std::vector<Byte>(data.begin(), data.end());
103 }

References payload_, and Conversion::toString().

Referenced by ProgramAnnotation().

Here is the call graph for this function:

◆ setStringValue()

void TTAProgram::ProgramAnnotation::setStringValue ( const std::string &  data)
inline

Definition at line 216 of file ProgramAnnotation.hh.

216  {
217  payload_ = std::vector<Byte>(data.begin(), data.end());
218  };

References payload_.

Referenced by ProgramAnnotation().

◆ stringValue()

std::string TTAProgram::ProgramAnnotation::stringValue ( ) const

The payload data as a std::string.

Returns
The data as a std::string.

Definition at line 90 of file ProgramAnnotation.cc.

90  {
91  return std::string(payload_.begin(), payload_.end());
92 }

References payload_.

Referenced by MachineConnectivityCheck::addAnnotatedFUs(), BFOptimization::assign(), DataDependenceGraphBuilder::findStaticRegisters(), intValue(), DataDependenceGraphBuilder::isAlwaysDifferentFU(), DataDependenceGraphBuilder::memoryCategory(), and TTAProgram::Move::sourceFileName().

Member Data Documentation

◆ id_

Id TTAProgram::ProgramAnnotation::id_
private

the id

Definition at line 226 of file ProgramAnnotation.hh.

Referenced by id().

◆ payload_

std::vector<Byte> TTAProgram::ProgramAnnotation::payload_
private

the payload data

Definition at line 228 of file ProgramAnnotation.hh.

Referenced by payload(), setIntValue(), setStringValue(), and stringValue().


The documentation for this class was generated from the following files:
TTAProgram::ProgramAnnotation::ANN_REGISTER_IPARAM_SAVE
@ ANN_REGISTER_IPARAM_SAVE
Save to int param reg.
Definition: ProgramAnnotation.hh:99
TTAProgram::ProgramAnnotation::ANN_STACKFRAME_RA_DEALLOC
@ ANN_STACKFRAME_RA_DEALLOC
Return Addr dealloc.
Definition: ProgramAnnotation.hh:61
TTAProgram::ProgramAnnotation::ANN_STACKFRAME_FPR_RESTORE
@ ANN_STACKFRAME_FPR_RESTORE
FPR restore by pop.
Definition: ProgramAnnotation.hh:73
TTAProgram::ProgramAnnotation::ANN_REGISTER_RV_SAVE
@ ANN_REGISTER_RV_SAVE
Save to RV register.
Definition: ProgramAnnotation.hh:95
TTAProgram::ProgramAnnotation::ANN_IRF_FETCH_BLOCK_BEGIN
@ ANN_IRF_FETCH_BLOCK_BEGIN
Beginning of a IRF fetch block.
Definition: ProgramAnnotation.hh:186
TTAProgram::ProgramAnnotation::ANN_PARALLEL_REGION_ID
@ ANN_PARALLEL_REGION_ID
The ID from the _TCEPREGION_START(N) markers.
Definition: ProgramAnnotation.hh:171
TTAProgram::ProgramAnnotation::ANN_STACKFRAME_GPR_SAVE
@ ANN_STACKFRAME_GPR_SAVE
GPR save by pushing.
Definition: ProgramAnnotation.hh:65
TTAProgram::ProgramAnnotation::ANN_JUMP_FUNCTION_CALL
@ ANN_JUMP_FUNCTION_CALL
The JUMP in the annotated move is a function call and should be treated as such in the data dependenc...
Definition: ProgramAnnotation.hh:129
TTAProgram::ProgramAnnotation::ANN_STACKUSE_SAVED_GPR
@ ANN_STACKUSE_SAVED_GPR
saved GPR
Definition: ProgramAnnotation.hh:87
TTAProgram::ProgramAnnotation::ANN_REJECTED_UNIT_SRC
@ ANN_REJECTED_UNIT_SRC
Src. unit rejected.
Definition: ProgramAnnotation.hh:118
TTAProgram::ProgramAnnotation::ANN_STACKFRAME_RA_ALLOC
@ ANN_STACKFRAME_RA_ALLOC
Return Address alloc.
Definition: ProgramAnnotation.hh:60
TTAProgram::ProgramAnnotation::ANN_STACKFRAME_UNKNOWN
@ ANN_STACKFRAME_UNKNOWN
Unknown SF-related.
Definition: ProgramAnnotation.hh:79
TTAProgram::ProgramAnnotation::ANN_STACKFRAME_RA_SAVE
@ ANN_STACKFRAME_RA_SAVE
Return Address save.
Definition: ProgramAnnotation.hh:62
TTAProgram::ProgramAnnotation::ANN_POINTER_ADDR_SPACE
@ ANN_POINTER_ADDR_SPACE
Definition: ProgramAnnotation.hh:177
TTAProgram::ProgramAnnotation::ANN_STACKFRAME_FPR_SAVE
@ ANN_STACKFRAME_FPR_SAVE
FPR save by pushing.
Definition: ProgramAnnotation.hh:70
TTAProgram::ProgramAnnotation::ANN_STACKFRAME_GPR_SAVE_BEGIN
@ ANN_STACKFRAME_GPR_SAVE_BEGIN
Used to count saves.
Definition: ProgramAnnotation.hh:64
TTAProgram::ProgramAnnotation::ANN_STACKFRAME_GPR_RESTORE
@ ANN_STACKFRAME_GPR_RESTORE
GPR restore by pop.
Definition: ProgramAnnotation.hh:68
TTAProgram::ProgramAnnotation::ANN_STACKFRAME_LVAR_ALLOC
@ ANN_STACKFRAME_LVAR_ALLOC
Local variable alloc.
Definition: ProgramAnnotation.hh:56
TTAProgram::ProgramAnnotation::ANN_IRF_LOCAL_JUMP
@ ANN_IRF_LOCAL_JUMP
Definition: ProgramAnnotation.hh:191
TTAProgram::ProgramAnnotation::stringValue
std::string stringValue() const
Definition: ProgramAnnotation.cc:90
TTAProgram::ProgramAnnotation::ANN_STACKUSE_OUT_PARAM
@ ANN_STACKUSE_OUT_PARAM
output parameter.
Definition: ProgramAnnotation.hh:83
TPEF::InstructionAnnotation::MAX_ANNOTATION_BYTES
static const size_t MAX_ANNOTATION_BYTES
Maximum number of bytes that annotation may contain.
Definition: InstructionElement.hh:65
TTAProgram::ProgramAnnotation::ANN_STACKFRAME_GPR_RESTORE_REG
@ ANN_STACKFRAME_GPR_RESTORE_REG
Definition: ProgramAnnotation.hh:67
TTAProgram::ProgramAnnotation::ANN_STACKFRAME_FPR_SAVE_BEGIN
@ ANN_STACKFRAME_FPR_SAVE_BEGIN
Used to count saves.
Definition: ProgramAnnotation.hh:69
TTAProgram::ProgramAnnotation::ANN_STACKUSE_IN_PARAM
@ ANN_STACKUSE_IN_PARAM
input parameter
Definition: ProgramAnnotation.hh:86
TTAProgram::ProgramAnnotation::ANN_STACKUSE_RA
@ ANN_STACKUSE_RA
ra, old frontend
Definition: ProgramAnnotation.hh:85
TTAProgram::ProgramAnnotation::ANN_STACKFRAME_LVAR_RA_ALLOC
@ ANN_STACKFRAME_LVAR_RA_ALLOC
Local var+RA alloc.
Definition: ProgramAnnotation.hh:58
TTAProgram::ProgramAnnotation::ANN_REGISTER_BEGIN
@ ANN_REGISTER_BEGIN
Definition: ProgramAnnotation.hh:94
TTAProgram::ProgramAnnotation::ANN_STACKFRAME_GPR_SAVE_REG
@ ANN_STACKFRAME_GPR_SAVE_REG
Definition: ProgramAnnotation.hh:66
TTAProgram::ProgramAnnotation::ANN_STACKFRAME_LVAR_DEALLOC
@ ANN_STACKFRAME_LVAR_DEALLOC
Local var dealloc.
Definition: ProgramAnnotation.hh:57
TTAProgram::ProgramAnnotation::ANN_UNDEF_ID
@ ANN_UNDEF_ID
an illegal annotation ID (the id is only 24 bits, this has more meaningful bits)
Definition: ProgramAnnotation.hh:202
TTAProgram::ProgramAnnotation::ANN_IRF_NOCACHE_BEGIN
@ ANN_IRF_NOCACHE_BEGIN
Just to show this starts a non-irf block.
Definition: ProgramAnnotation.hh:196
TTAProgram::ProgramAnnotation::ANN_REGISTER_SP_READ
@ ANN_REGISTER_SP_READ
Stack Pointer read.
Definition: ProgramAnnotation.hh:98
TTAProgram::ProgramAnnotation::ANN_DEBUG_SOURCE_CODE_LINE
@ ANN_DEBUG_SOURCE_CODE_LINE
The line number in the source code file the annotated move originates from.
Definition: ProgramAnnotation.hh:138
TTAProgram::ProgramAnnotation::ANN_IRF_FETCH_BLOCK_FT
@ ANN_IRF_FETCH_BLOCK_FT
Definition: ProgramAnnotation.hh:187
TTAProgram::ProgramAnnotation::ANN_STACKFRAME_LVAR_RA_DEALLOC
@ ANN_STACKFRAME_LVAR_RA_DEALLOC
Local var+RA dealloc.
Definition: ProgramAnnotation.hh:59
TTAProgram::ProgramAnnotation::ANN_FIRST_RESERVED
@ ANN_FIRST_RESERVED
First reserved annot.
Definition: ProgramAnnotation.hh:53
Conversion::toString
static std::string toString(const T &source)
TTAProgram::ProgramAnnotation::ANN_IRF_FETCH_BLOCK_RET
@ ANN_IRF_FETCH_BLOCK_RET
Definition: ProgramAnnotation.hh:190
TTAProgram::ProgramAnnotation::ANN_LAST_RESERVED
@ ANN_LAST_RESERVED
Last reserved annot.
Definition: ProgramAnnotation.hh:54
TTAProgram::ProgramAnnotation::ANN_STACKFRAME_FPR_SAVE_REG
@ ANN_STACKFRAME_FPR_SAVE_REG
FPR save by pushing.
Definition: ProgramAnnotation.hh:71
TTAProgram::ProgramAnnotation::ANN_REGISTER_FP_READ
@ ANN_REGISTER_FP_READ
Frame Pointer read.
Definition: ProgramAnnotation.hh:102
assert
#define assert(condition)
Definition: Application.hh:86
TTAProgram::ProgramAnnotation::ANN_REGISTER_RV_READ
@ ANN_REGISTER_RV_READ
Read from RV reg.
Definition: ProgramAnnotation.hh:96
TTAProgram::ProgramAnnotation::ANN_ALLOWED_UNIT_SRC
@ ANN_ALLOWED_UNIT_SRC
Candidate units can be passed for resource manager for choosing the source/destination unit of the mo...
Definition: ProgramAnnotation.hh:112
TTAProgram::ProgramAnnotation::ANN_REJECTED_UNIT_DST
@ ANN_REJECTED_UNIT_DST
Dst. unit rejected.
Definition: ProgramAnnotation.hh:119
TTAProgram::ProgramAnnotation::ANN_CONSTANT_MEM
@ ANN_CONSTANT_MEM
Constant memory access.
Definition: ProgramAnnotation.hh:183
TTAProgram::ProgramAnnotation::ANN_CONN_CANDIDATE_UNIT_SRC
@ ANN_CONN_CANDIDATE_UNIT_SRC
Src. unit candidate.
Definition: ProgramAnnotation.hh:115
TTAProgram::ProgramAnnotation::ANN_STACKFRAME_OUT_PARAM_ALLOC
@ ANN_STACKFRAME_OUT_PARAM_ALLOC
outgoing param alloc
Definition: ProgramAnnotation.hh:74
TTAProgram::ProgramAnnotation::id_
Id id_
the id
Definition: ProgramAnnotation.hh:226
TTAProgram::ProgramAnnotation::ANN_STACKFRAME_BEGIN
@ ANN_STACKFRAME_BEGIN
First stackframe ann.
Definition: ProgramAnnotation.hh:55
TTAProgram::ProgramAnnotation::ANN_STACKUSE_LOCAL_VARIABLE
@ ANN_STACKUSE_LOCAL_VARIABLE
local variable
Definition: ProgramAnnotation.hh:84
TTAProgram::ProgramAnnotation::setIntValue
void setIntValue(int value)
Definition: ProgramAnnotation.cc:100
TTAProgram::ProgramAnnotation::ANN_STACKUSE_END
@ ANN_STACKUSE_END
Definition: ProgramAnnotation.hh:92
TTAProgram::ProgramAnnotation::ANN_POINTER_NOALIAS
@ ANN_POINTER_NOALIAS
Definition: ProgramAnnotation.hh:176
TTAProgram::ProgramAnnotation::ANN_OPENCL_WORK_ITEM_ID
@ ANN_OPENCL_WORK_ITEM_ID
Definition: ProgramAnnotation.hh:153
TTAProgram::ProgramAnnotation::ANN_STACKUSE_FP_SAVE
@ ANN_STACKUSE_FP_SAVE
frame ptr save/load
Definition: ProgramAnnotation.hh:91
TTAProgram::ProgramAnnotation::ANN_REQUIRES_LIMM
@ ANN_REQUIRES_LIMM
Definition: ProgramAnnotation.hh:125
TTAProgram::ProgramAnnotation::ANN_LOOP_TRIP_COUNT
@ ANN_LOOP_TRIP_COUNT
An instruction annotated with this annotation is the first instruction of a basic block in a loop wit...
Definition: ProgramAnnotation.hh:165
TTAProgram::ProgramAnnotation::ANN_REGISTER_FP_SAVE
@ ANN_REGISTER_FP_SAVE
Frame Pointer save.
Definition: ProgramAnnotation.hh:101
TTAProgram::ProgramAnnotation::ANN_ALLOWED_UNIT_DST
@ ANN_ALLOWED_UNIT_DST
Dst. unit candidate.
Definition: ProgramAnnotation.hh:113
TTAProgram::ProgramAnnotation::payload_
std::vector< Byte > payload_
the payload data
Definition: ProgramAnnotation.hh:228
TTAProgram::ProgramAnnotation::setStringValue
void setStringValue(const std::string &data)
Definition: ProgramAnnotation.hh:216
TTAProgram::ProgramAnnotation::ANN_IRF_BLOCK_FWJUMP_CYCLES
@ ANN_IRF_BLOCK_FWJUMP_CYCLES
how many stalls may be needed due forward jumps
Definition: ProgramAnnotation.hh:198
TTAProgram::ProgramAnnotation::ANN_STACKUSE_RA_SAVE
@ ANN_STACKUSE_RA_SAVE
ra, new frontend
Definition: ProgramAnnotation.hh:90
TTAProgram::ProgramAnnotation::ANN_STACKUSE_BEGIN
@ ANN_STACKUSE_BEGIN
Definition: ProgramAnnotation.hh:82
TTAProgram::ProgramAnnotation::ANN_POINTER_NAME
@ ANN_POINTER_NAME
information retrieved (from LLVM) about a pointer access
Definition: ProgramAnnotation.hh:174
TTAProgram::ProgramAnnotation::ANN_LOOP_INNER
@ ANN_LOOP_INNER
An instruction annotated with this annotation is the first instruction of a basic block in an inner l...
Definition: ProgramAnnotation.hh:168
TTAProgram::ProgramAnnotation::ANN_STACKFRAME_STACK_INIT
@ ANN_STACKFRAME_STACK_INIT
Stack initialization.
Definition: ProgramAnnotation.hh:78
TTAProgram::ProgramAnnotation::ANN_STACKUSE_SAVED_FPR
@ ANN_STACKUSE_SAVED_FPR
saved FPR
Definition: ProgramAnnotation.hh:88
TTAProgram::ProgramAnnotation::ANN_STACKFRAME_PROCEDURE_RETURN
@ ANN_STACKFRAME_PROCEDURE_RETURN
precedure return jmp
Definition: ProgramAnnotation.hh:76
TTAProgram::ProgramAnnotation::ANN_STACKUSE_SPILL
@ ANN_STACKUSE_SPILL
spilled variable
Definition: ProgramAnnotation.hh:89
TTAProgram::ProgramAnnotation::ANN_VECTOR_ID
@ ANN_VECTOR_ID
Vector indentifier for vector operations.
Definition: ProgramAnnotation.hh:180
TTAProgram::ProgramAnnotation::ANN_REGISTER_IPARAM_READ
@ ANN_REGISTER_IPARAM_READ
Read from int param.
Definition: ProgramAnnotation.hh:100
TTAProgram::ProgramAnnotation::ANN_IRF_FETCH_BLOCK_CALL
@ ANN_IRF_FETCH_BLOCK_CALL
Definition: ProgramAnnotation.hh:189
TTAProgram::ProgramAnnotation::ANN_IRF_BLOCK_HEADER_NOCACHE
@ ANN_IRF_BLOCK_HEADER_NOCACHE
Definition: ProgramAnnotation.hh:194
TTAProgram::ProgramAnnotation::ANN_OPENCL_WORK_ITEM_ID_LAST
@ ANN_OPENCL_WORK_ITEM_ID_LAST
Definition: ProgramAnnotation.hh:158
TTAProgram::ProgramAnnotation::ANN_STACKFRAME_END
@ ANN_STACKFRAME_END
Last stackfame annot.
Definition: ProgramAnnotation.hh:80
TTAProgram::ProgramAnnotation::ANN_IRF_BLOCK_HEADER
@ ANN_IRF_BLOCK_HEADER
Dummy empty instrution for block header.
Definition: ProgramAnnotation.hh:193
TTAProgram::ProgramAnnotation::ANN_DEBUG_SOURCE_CODE_PATH
@ ANN_DEBUG_SOURCE_CODE_PATH
debugging info annotations
Definition: ProgramAnnotation.hh:134
TTAProgram::ProgramAnnotation::ANN_CONNECTIVITY_MOVE
@ ANN_CONNECTIVITY_MOVE
A reg to reg move that was added because of missing connectivity between the original target and dest...
Definition: ProgramAnnotation.hh:123
TTAProgram::ProgramAnnotation::ANN_IRF_FETCH_BLOCK_JUMP
@ ANN_IRF_FETCH_BLOCK_JUMP
Definition: ProgramAnnotation.hh:188
TTAProgram::ProgramAnnotation::ANN_STACKFRAME_RA_RESTORE
@ ANN_STACKFRAME_RA_RESTORE
Return Addr restore.
Definition: ProgramAnnotation.hh:63
Conversion::toInt
static int toInt(const T &source)
TTAProgram::ProgramAnnotation::ANN_STACKFRAME_FPR_RESTORE_REG
@ ANN_STACKFRAME_FPR_RESTORE_REG
FPR restore by pop.
Definition: ProgramAnnotation.hh:72
TTAProgram::ProgramAnnotation::ANN_POINTER_OFFSET
@ ANN_POINTER_OFFSET
Definition: ProgramAnnotation.hh:175
TTAProgram::ProgramAnnotation::ANN_STACKFRAME_OUT_PARAM_DEALLOC
@ ANN_STACKFRAME_OUT_PARAM_DEALLOC
outgoing param deall.
Definition: ProgramAnnotation.hh:75
TTAProgram::ProgramAnnotation::ANN_REGISTER_SP_SAVE
@ ANN_REGISTER_SP_SAVE
save to Stack pointer
Definition: ProgramAnnotation.hh:97
TTAProgram::ProgramAnnotation::payload
const std::vector< Byte > & payload() const
Definition: ProgramAnnotation.cc:121
TTAProgram::ProgramAnnotation::ANN_REGISTER_END
@ ANN_REGISTER_END
Definition: ProgramAnnotation.hh:103
TTAProgram::ProgramAnnotation::ANN_CONN_CANDIDATE_UNIT_DST
@ ANN_CONN_CANDIDATE_UNIT_DST
Dst. unit candidate.
Definition: ProgramAnnotation.hh:116
TTAProgram::ProgramAnnotation::ANN_JUMP_TO_NEXT
@ ANN_JUMP_TO_NEXT
Definition: ProgramAnnotation.hh:160