Go to the documentation of this file.
34 #ifndef TTA_DDG_BUILDER_HH
35 #define TTA_DDG_BUILDER_HH
51 class TerminalRegister;
84 bool createMemAndFUDeps =
true,
85 bool createDeathInformation =
true,
93 bool createMemAndFUDeps =
true,
163 bool aliveInformationNeeded =
true);
177 bool addLoopProperty);
255 std::set<MoveNodeUse>& prevNodes,
260 std::set<MoveNodeUse>& defines);
273 bool guardedKillFound);
280 bool priorize =
false);
290 std::map<int,TCEString>& registers);
294 std::map<int,TCEString>& registers);
298 std::map<int,TCEString>& registers);
302 std::map<int,TCEString>& registers);
307 bool setLoopProperty);
const TTAMachine::Machine * mach_
BBState state_
State of the BB.
bool isTriggering(const MoveNode &mn)
LiveRangeData::MoveNodeUseMapSet MoveNodeUseMapSet
std::map< int, TCEString > SpecialRegisters
@ BB_STATES
BB which is already processed and is not queued.
void clearUnneededBookkeeping()
BBDataList blocksByState_[BB_STATES]
void createMemAndFUstateDeps()
bool constructed_
Whether the BB has been constructed or not.
void constructIndividualFromInlineAsmBB(ConstructionPhase phase)
void processResultRead(MoveNode &moveNode)
void findStaticRegisters(TTAProgram::CodeSnippet &cs, std::map< int, TCEString > ®isters)
find special register data from old frontend code
std::set< MoveNodeUse > MoveNodeUseSet
LiveRangeData::MoveNodeUsePair MoveNodeUsePair
void processCall(MoveNode &mn)
DataDependenceGraphBuilder()
void processTriggerRegistersAndOperations(MoveNode &moveNode, Operation &dop)
std::set< BasicBlockNode *, typename BasicBlockNode ::Comparator > NodeSet
void initializeBBStates()
void processEntryNode(MoveNode &mn)
void processMemUse(MoveNodeUse mnd)
bool appendUseMapSets(const MoveNodeUseMapSet &srcMap, MoveNodeUseMapSet &dstMap, bool addLoopProperty)
void updateMemUse(MoveNodeUse mnd, const TCEString &category)
AliasAnalyzerVector aliasAnalyzers_
void createSideEffectEdges(MoveNodeUseSet &prevMoves, const MoveNode &mn, Operation &dop)
void processMemWrite(MoveNodeUse mnd)
LiveRangeData::MoveNodeUseMap MoveNodeUseMap
std::set< MoveNodeUse > earlierWritesWithSameGuard(MoveNodeUse &mnd, std::set< MoveNodeUse > &defines)
BasicBlockNode * currentBB_
void processGuard(MoveNode &moveNode)
std::map< TCEString, MoveNodeUseSet > MoveNodeUseMapSet
BasicBlockNode * queueFirstBB()
void constructBB(BasicBlockNodeSet &inputBlocks)
@ REGISTERS_AND_PROGRAM_OPERATIONS
bool updateRegistersUsedInOrAfter(BBData &bbd)
void appendMoveNodeUse(const LiveRangeData::MoveNodeUseSet &src, LiveRangeData::MoveNodeUseSet &dst, bool setLoopProperty)
TCEString memoryCategory(const MoveNodeUse &mnd)
std::shared_ptr< ProgramOperation > ProgramOperationPtr
void iterateBBs(ConstructionPhase phase)
LiveRangeData::MoveNodeUseSetPair MoveNodeUseSetPair
ProgramOperationPtr destPending_
ProgramOperations lacking operands.
ProgramOperationPtr readPending_
ProgramOperations lacking result read.
void processDestination(class MoveNode &moveNode, ConstructionPhase phase)
ControlFlowGraph::NodeSet BasicBlockNodeSet
@ BB_READY
BB which is queued to be processed.
@ BB_QUEUED
Basic block we have not yet encountered.
virtual ~DataDependenceGraphBuilder()
void createTriggerDependencies(class MoveNode &moveNode, class Operation &dop)
void updateBB(BBData &bbd, ConstructionPhase phase)
void addAliasAnalyzer(MemoryAliasAnalyzer *analyzer)
bool checkAndCreateMemDep(MoveNodeUse prev, MoveNodeUse mnd, DataDependenceEdge::DependenceType depType)
void processTriggerPO(class MoveNode &moveNode, Operation &dop)
DataDependenceGraph::NodeSet MNodeSet
void searchRegisterDeaths()
void changeState(BBData &bbd, BBState newState, bool priorize=false)
void checkAndCreateMemAntideps(MoveNodeUse &mnd, std::set< MoveNodeUse > &prevNodes, DataDependenceEdge::DependenceType depType, bool traceable)
bool updateRegistersAliveAfter(BBData &bbd)
BBData(BasicBlockNode &bb)
void createRegisterAntideps(const TCEString ®, MoveNodeUse &mnd, MoveNodeUseSet &predecessorNodes, DataDependenceEdge::DependenceType depType, bool guardedKillFound)
void createRegisterDeps()
bool isAlwaysDifferentFU(const MoveNode *srcMN, const MoveNode *dstMN)
bool isAddressTraceable(const ProgramOperation &pop)
void iterateRegisterDeaths()
void createOperationEdges(ProgramOperationPtr po)
void updatePreceedingRegistersUsedAfter(BBData &bbd, bool firstTime)
std::vector< MemoryAliasAnalyzer * > AliasAnalyzerVector
void processRegWrite(MoveNodeUse mn, const TCEString ®)
std::map< TCEString, MoveNodeUse > MoveNodeUseMap
std::list< BBData * > BBDataList
static const TCEString RA_NAME
void processSource(MoveNode &moveNode)
bool updateMemAndFuAliveAfter(BBData &bbd)
std::pair< TCEString, MoveNodeUseSet > MoveNodeUseSetPair
DataDependenceGraph * currentDDG_
void updateMemWrite(MoveNodeUse mnd, const TCEString &category)
void setSucceedingPredepsForBB(TTAProgram::BasicBlock &processedBB, BasicBlockNode &successor, bool queueAll, bool loop, ConstructionPhase phase)
std::set< TCEString > allParamRegs_
void processOperand(class MoveNode &moveNode, Operation &dop)
virtual DataDependenceGraph * build(ControlFlowGraph &cGraph, DataDependenceGraph::AntidependenceLevel antidependenceLevel, const TTAMachine::Machine &mach, const UniversalMachine *um=NULL, bool createMemAndFUDeps=true, bool createDeathInformation=true, llvm::AliasAnalysis *AA=NULL)
void setSucceedingPredeps(BBData &bbd, bool queueAll, ConstructionPhase phase)
void processReturn(MoveNode &moveNode)
InterPassData * interPassData_
bool hasEarlierMemWriteToSameAddressWithSameGuard(MoveNodeUse &mnd, std::set< MoveNodeUse > &defines)
void processRegUse(MoveNodeUse mn, const TCEString ®)
bool hasEarlierWriteWithSameGuard(MoveNodeUse &mnd, std::set< MoveNodeUse > &defines)
@ MEMORY_AND_SIDE_EFFECTS
void constructIndividualBB(ConstructionPhase phase)
MemoryAliasAnalyzer::AliasingResult analyzeMemoryAlias(const ProgramOperation &pop1, const ProgramOperation &pop2, MoveNodeUse::BBRelation bbInfo)
void processTriggerMemoryAndFUStates(MoveNode &moveNode, Operation &dop)
LiveRangeData::MoveNodeUseSet MoveNodeUseSet
SpecialRegisters specialRegisters_
contains stack pointer, RV and parameter registers.
std::pair< TCEString, MoveNodeUse > MoveNodeUsePair
std::map< BasicBlockNode *, BBData * > BBDataMap