OpenASIP
2.0
|
#include <ProgramAnnotation.hh>
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< Byte > | payload_ |
the payload data More... | |
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.
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.
TTAProgram::ProgramAnnotation::ProgramAnnotation | ( | Id | id, |
int | value | ||
) |
Definition at line 60 of file ProgramAnnotation.cc.
References setIntValue().
TTAProgram::ProgramAnnotation::ProgramAnnotation | ( | Id | id, |
const std::string & | data = "" |
||
) |
Constructor.
id | The id of the annotation (a 24-bit value). |
data | The payload data as a string. |
Definition at line 53 of file ProgramAnnotation.cc.
References assert, TPEF::InstructionAnnotation::MAX_ANNOTATION_BYTES, and setStringValue().
Constructor.
id | The id of the annotation (a 24-bit value). |
data | The payload data as a byte vector. |
Definition at line 71 of file ProgramAnnotation.cc.
References assert, TPEF::InstructionAnnotation::MAX_ANNOTATION_BYTES, and payload().
TTAProgram::ProgramAnnotation::~ProgramAnnotation | ( | ) |
ProgramAnnotation::Id TTAProgram::ProgramAnnotation::id | ( | ) | const |
Returns the id of the annotation.
Definition at line 111 of file ProgramAnnotation.cc.
References id_.
Referenced by TTAProgram::AnnotatedInstructionElement::addAnnotation(), BFOptimization::assign(), llvm::LLVMTCEBuilder::copyFUAnnotations(), TTAProgram::ProgramWriter::createCodeSection(), DataDependenceGraphBuilder::findStaticRegisters(), DataDependenceGraphBuilder::memoryCategory(), DataDependenceGraph::mergeAndKeepSource(), DataDependenceGraph::mergeAndKeepUser(), BFUpdateMoveOnBypass::operator()(), and TTAProgram::AnnotatedInstructionElement::setAnnotation().
int TTAProgram::ProgramAnnotation::intValue | ( | ) | const |
Definition at line 95 of file ProgramAnnotation.cc.
References stringValue(), and Conversion::toInt().
Referenced by PRegionAliasAnalyzer::analyze().
const std::vector< Byte > & TTAProgram::ProgramAnnotation::payload | ( | ) | const |
Return the payload data as a non-mutable char vector.
Definition at line 121 of file ProgramAnnotation.cc.
References payload_.
Referenced by llvm::LLVMTCEBuilder::copyFUAnnotations(), TTAProgram::ProgramWriter::createCodeSection(), DataDependenceGraph::mergeAndKeepSource(), DataDependenceGraph::mergeAndKeepUser(), BFUpdateMoveOnBypass::operator()(), and ProgramAnnotation().
void TTAProgram::ProgramAnnotation::setIntValue | ( | int | value | ) |
Definition at line 100 of file ProgramAnnotation.cc.
References payload_, and Conversion::toString().
Referenced by ProgramAnnotation().
|
inline |
Definition at line 216 of file ProgramAnnotation.hh.
References payload_.
Referenced by ProgramAnnotation().
std::string TTAProgram::ProgramAnnotation::stringValue | ( | ) | const |
The payload data as a std::string.
Definition at line 90 of file ProgramAnnotation.cc.
References payload_.
Referenced by MachineConnectivityCheck::addAnnotatedFUs(), BFOptimization::assign(), DataDependenceGraphBuilder::findStaticRegisters(), intValue(), DataDependenceGraphBuilder::isAlwaysDifferentFU(), DataDependenceGraphBuilder::memoryCategory(), and TTAProgram::Move::sourceFileName().
|
private |
|
private |
the payload data
Definition at line 228 of file ProgramAnnotation.hh.
Referenced by payload(), setIntValue(), setStringValue(), and stringValue().