OpenASIP
2.0
|
#include <AnnotatedInstructionElement.hh>
Public Member Functions | |
AnnotatedInstructionElement () | |
~AnnotatedInstructionElement () | |
void | addAnnotation (const ProgramAnnotation &annotation) |
void | setAnnotation (const ProgramAnnotation &annotation) |
ProgramAnnotation | annotation (int index, ProgramAnnotation::Id id=ProgramAnnotation::ANN_UNDEF_ID) const |
int | annotationCount (ProgramAnnotation::Id id=ProgramAnnotation::ANN_UNDEF_ID) const |
void | removeAnnotations (ProgramAnnotation::Id id=ProgramAnnotation::ANN_UNDEF_ID) |
bool | hasAnnotations (ProgramAnnotation::Id id=ProgramAnnotation::ANN_UNDEF_ID) const |
bool | hasAnnotation (ProgramAnnotation::Id id, const TCEString &data) const |
void | copyAnnotationsFrom (const AnnotatedInstructionElement &other) |
Private Types | |
typedef std::multimap< ProgramAnnotation::Id, ProgramAnnotation > | AnnotationIndex |
a type for the container of the annotations More... | |
Private Attributes | |
AnnotationIndex | annotations_ |
container for annotations More... | |
AnnotatedInstructionElements provide an interface for the classes that can be attached an instruction annotation.
Basically the TerminalImmediate and Move inherit this to provide such capabilities.
Definition at line 53 of file AnnotatedInstructionElement.hh.
|
private |
a type for the container of the annotations
Definition at line 76 of file AnnotatedInstructionElement.hh.
TTAProgram::AnnotatedInstructionElement::AnnotatedInstructionElement | ( | ) |
TTAProgram::AnnotatedInstructionElement::~AnnotatedInstructionElement | ( | ) |
void TTAProgram::AnnotatedInstructionElement::addAnnotation | ( | const ProgramAnnotation & | annotation | ) |
Adds an annotation to the instruction element.
annotation | The annotation to add. |
Definition at line 63 of file AnnotatedInstructionElement.cc.
References annotation(), annotations_, and TTAProgram::ProgramAnnotation::id().
Referenced by llvm::LLVMTCEBuilder::addCandidateLSUAnnotations(), RegisterCopyAdder::addCandidateSetAnnotations(), RegisterCopyAdder::addConnectionRegisterCopies(), RegisterCopyAdder::addConnectionRegisterCopiesImmediate(), InlineAsmParser::addDebugInfoToInlineAsmBB(), llvm::LLVMTCEBuilder::addPointerAnnotations(), annotateAllInputs(), annotateAllOutputs(), llvm::LLVMTCEBuilder::copyFUAnnotations(), TTAProgram::TPEFProgramFactory::createInstruction(), TTAProgram::TPEFProgramFactory::createTerminal(), llvm::LLVMTCEBuilder::debugDataToAnnotations(), CallsToJumps::handleControlFlowGraph(), DataDependenceGraph::mergeAndKeepSource(), DataDependenceGraph::mergeAndKeepUser(), and BFCopyRegWithOp::splitMove().
ProgramAnnotation TTAProgram::AnnotatedInstructionElement::annotation | ( | int | index, |
ProgramAnnotation::Id | id = ProgramAnnotation::ANN_UNDEF_ID |
||
) | const |
Returns the annotation at the given index (and id).
index | The index of the annotation. |
id | The id of the annotation (optional). |
OutOfRange | If the index is out of range. |
Definition at line 100 of file AnnotatedInstructionElement.cc.
References __func__, TTAProgram::ProgramAnnotation::ANN_UNDEF_ID, and annotations_.
Referenced by MachineConnectivityCheck::addAnnotatedFUs(), addAnnotation(), PRegionAliasAnalyzer::analyze(), BFOptimization::assign(), TTAProgram::Move::copy(), llvm::LLVMTCEBuilder::copyFUAnnotations(), ControlFlowGraph::createBlock(), TTAProgram::ProgramWriter::createCodeSection(), DataDependenceGraphBuilder::findStaticRegisters(), DataDependenceGraphBuilder::isAlwaysDifferentFU(), DataDependenceGraphBuilder::memoryCategory(), DataDependenceGraph::mergeAndKeepSource(), DataDependenceGraph::mergeAndKeepUser(), setAnnotation(), TTAProgram::Move::sourceFileName(), and TTAProgram::Move::sourceLineNumber().
int TTAProgram::AnnotatedInstructionElement::annotationCount | ( | ProgramAnnotation::Id | id = ProgramAnnotation::ANN_UNDEF_ID | ) | const |
Returns the count of annotations (with the given id).
id | The id of the annotations to count (optional). |
Definition at line 133 of file AnnotatedInstructionElement.cc.
References TTAProgram::ProgramAnnotation::ANN_UNDEF_ID, and annotations_.
Referenced by MachineConnectivityCheck::addAnnotatedFUs(), BFOptimization::assign(), TTAProgram::Move::copy(), llvm::LLVMTCEBuilder::copyFUAnnotations(), TTAProgram::ProgramWriter::createCodeSection(), DataDependenceGraphBuilder::findStaticRegisters(), BFOptimization::hasAmbiguousResources(), hasAnnotations(), DataDependenceGraphBuilder::memoryCategory(), and TTAProgram::Move::sourceLineNumber().
void TTAProgram::AnnotatedInstructionElement::copyAnnotationsFrom | ( | const AnnotatedInstructionElement & | other | ) |
Copies annotations from another annotated element.
Possible old annotations are deleted.
Definition at line 193 of file AnnotatedInstructionElement.cc.
References annotations_.
Referenced by TTAProgram::Instruction::copy().
bool TTAProgram::AnnotatedInstructionElement::hasAnnotation | ( | ProgramAnnotation::Id | id, |
const TCEString & | data | ||
) | const |
Returns true in case there's at least one annotation with the given id and the given data.
Definition at line 174 of file AnnotatedInstructionElement.cc.
References annotations_.
Referenced by RegisterCopyAdder::isAllowedUnit(), DataDependenceGraphBuilder::isAlwaysDifferentFU(), and ProgramOperation::isLegalFU().
bool TTAProgram::AnnotatedInstructionElement::hasAnnotations | ( | ProgramAnnotation::Id | id = ProgramAnnotation::ANN_UNDEF_ID | ) | const |
Returns true in case there's at least one annotation with the given id.
id | An annotation id. |
Definition at line 165 of file AnnotatedInstructionElement.cc.
References annotationCount().
Referenced by PRegionAliasAnalyzer::analyze(), CycleLookBackSoftwareBypasser::bypassNode(), ControlFlowGraph::createBlock(), TTAProgram::ProgramWriter::createCodeSection(), llvm::LLVMTCEBuilder::hasAmbiguousASpaceRefs(), ControlFlowGraph::indirectJump(), RegisterCopyAdder::isAllowedUnit(), OutputPSocketBroker::isAlreadyAssigned(), DataDependenceGraphBuilder::isAlwaysDifferentFU(), OutputPSocketBroker::isApplicable(), IUBroker::isApplicable(), TTAProgram::Move::isFunctionCall(), TTAProgram::Move::isReturn(), DataDependenceGraphBuilder::memoryCategory(), BUBasicBlockScheduler::precedingTempMove(), BasicBlockScheduler::scheduleInputOperandTempMoves(), BUBasicBlockScheduler::scheduleInputOperandTempMoves(), SequentialScheduler::scheduleMove(), BasicBlockScheduler::scheduleMove(), BUBasicBlockScheduler::scheduleMove(), TTAProgram::Move::sourceFileName(), TTAProgram::Move::sourceLineNumber(), BasicBlockScheduler::succeedingTempMove(), BF2Scheduler::unreservePreallocatedFUs(), BasicBlockScheduler::unschedule(), and SequentialScheduler::unschedule().
void TTAProgram::AnnotatedInstructionElement::removeAnnotations | ( | ProgramAnnotation::Id | id = ProgramAnnotation::ANN_UNDEF_ID | ) |
Removes all annotations (with the given id).
id | The id of the annotations to remove (optional). |
Definition at line 146 of file AnnotatedInstructionElement.cc.
References TTAProgram::ProgramAnnotation::ANN_UNDEF_ID, and annotations_.
Referenced by BFOptimization::setPrologDstFUAnno(), BFOptimization::setPrologSrcFUAnno(), BFUpdateMoveOnBypass::undoOnlyMe(), BFCopyRegWithOp::undoSplit(), DataDependenceGraph::unMergeUser(), BF2Scheduler::unreservePreallocatedFUs(), BasicBlockScheduler::unschedule(), and SequentialScheduler::unschedule().
void TTAProgram::AnnotatedInstructionElement::setAnnotation | ( | const ProgramAnnotation & | annotation | ) |
Sets an annotation to the instruction element as the sole annotation of that type.
Removes all annotations with the same type before adding the annotation.
annotation | The annotation to set. |
Definition at line 79 of file AnnotatedInstructionElement.cc.
References annotation(), annotations_, and TTAProgram::ProgramAnnotation::id().
Referenced by RegisterCopyAdder::addConnectionRegisterCopies(), RegisterCopyAdder::addConnectionRegisterCopiesImmediate(), llvm::LLVMTCEBuilder::debugDataToAnnotations(), MoveNodeDuplicator::duplicateMove(), BFRegCopy::operator()(), SequentialScheduler::scheduleMove(), BasicBlockScheduler::scheduleMove(), BUBasicBlockScheduler::scheduleMove(), BFOptimization::setPrologDstFUAnno(), BFOptimization::setPrologSrcFUAnno(), and CopyingDelaySlotFiller::updateJumpsAndCfg().
|
private |
container for annotations
Definition at line 79 of file AnnotatedInstructionElement.hh.
Referenced by addAnnotation(), annotation(), annotationCount(), copyAnnotationsFrom(), hasAnnotation(), removeAnnotations(), and setAnnotation().