Go to the documentation of this file.
107 if (rf.
name().find(
"L_") == 0) {
113 for (DataDependenceGraph::EdgeSet::iterator i = iEdges.begin();
114 i != iEdges.end(); i++) {
126 connectingEdge = &edge;
149 for (DataDependenceGraph::EdgeSet::iterator i = oEdges.begin();
150 i != oEdges.end(); i++) {
153 if (&ddg.
headNode(edge) != &address) {
175 *src, address, result, *connectingEdge, oldReg, newReg);
276 for ([[maybe_unused]]
auto n: reverseJumpBBs) {
287 auto newMove = std::make_shared<TTAProgram::Move>(
293 resultMove.
parent(), newIns);
308 parent.
remove(operand1Ins);
313 parent.
remove(operand2Ins);
322 return reverseJumpBBs;
331 for (DataDependenceGraph::EdgeSet::iterator i = oEdges.begin();
332 i != oEdges.end(); i++) {
334 bool dstOpIsSelect =
false;
345 dstOpIsSelect =
true;
356 for (DataDependenceGraph::EdgeSet::iterator j = iEdges.begin();
357 j != iEdges.end(); j++) {
358 if ((**j).guardUse() &&
384 for (DataDependenceGraph::EdgeSet::iterator i = oEdges.begin();
385 i != oEdges.end(); i++) {
396 guardUseMove.
guard()));
397 if (guardUseMove.
isJump()) {
399 guardReverseBBs.insert(&jumpBBN);
405 return guardReverseBBs;
429 if (src1 ==
nullptr) {
437 if (src2 ==
nullptr) {
448 if (s1.value().intValue() == 0 || s2.value().intValue() == 0) {
457 int val = s1.value().intValue() + s2.value().intValue();
468 parent.
remove(operand1Ins);
473 parent.
remove(operand2Ins);
518 &
program->instructionReferenceManager();
531 for (
auto bbn : jumpNodes) {
565 for (
int j = 0; j < cfg.
nodeCount(); j++) {
568 for (
int i = 0; i < cfg.
outDegree(bbn); i++) {
const Operation & operation() const
TTAProgram::Program * program() const
void reverseGuardOnOutEdges(const BasicBlockNode &bbn)
virtual Edge & outEdge(const Node &node, const int index) const
void addMove(std::shared_ptr< Move > move)
ControlFlowGraph::NodeSet inverseGuardsOfHeads(DataDependenceGraph &ddg, DataDependenceGraph::EdgeSet &oEdges)
virtual Node & tailNode(const Edge &edge) const
virtual TCEString name() const
ProgramOperation & programOperation(int index)
void renamedSimpleLiveRange(MoveNode &src, MoveNode &dest, MoveNode &antidepPoint, DataDependenceEdge &lrEdge, const TCEString &oldReg, const TCEString &newReg)
virtual Node & headNode(const Edge &edge) const
void copyToProcedure(TTAProgram::Procedure &proc, TTAProgram::InstructionReferenceManager *irm=NULL)
Node & node(const int index) const
virtual const TTAMachine::RegisterFile & registerFile() const
bool isDestinationOperation() const
std::set< BasicBlockNode *, typename BasicBlockNode ::Comparator > NodeSet
bool isUnconditional() const
void handleControlFlowGraph(ControlFlowGraph &cfg, const TTAMachine::Machine &targetMachine)
Terminal & destination() const
virtual void remove(Instruction &ins)
void updateReferencesFromProcToCfg()
const TTAMachine::Bus & bus() const
void switchInputs(int idx1=1, int idx2=2)
void setGuard(MoveGuard *guard)
bool isSourceConstant() const
void handleCFGDDG(ControlFlowGraph &cfg, DataDependenceGraph &ddg)
ControlFlowGraph::NodeSet tryToRemoveXor(DataDependenceGraph &ddg, ProgramOperation &po, TTAProgram::InstructionReferenceManager *irm, ControlFlowGraph &cfg)
virtual TCEString name() const
DependenceType dependenceType() const
MoveNode * onlyRegisterRawSource(const MoveNode &mn, int allowGuardEdges=2, int backEdges=0) const
static const int DEFAULT_LOWMEM_MODE_THRESHOLD
virtual int outDegree(const Node &node) const
void combineNodes(MoveNode &node1, MoveNode &node2, MoveNode &destination)
TTAProgram::BasicBlock & basicBlock()
ProgramOperation & sourceOperation() const
#define assert(condition)
void deleteNode(MoveNode &node)
virtual void insertAfter(const Instruction &pos, Instruction *ins)
void setDestination(Terminal *dst)
virtual int lowMemModeThreshold() const
virtual int operationIndex() const
bool checkGuardReversalAllowed(DataDependenceGraph &ddg, DataDependenceGraph::EdgeSet &oEdges)
std::set< DataDependenceEdge *, typename DataDependenceEdge ::Comparator > EdgeSet
bool cfgAllowsJumpReversal(TTAProgram::Instruction &ins, ControlFlowGraph &cfg)
virtual int instructionCount() const
bool tryToOptimizeAddressReg(DataDependenceGraph &ddg, ProgramOperation &po)
bool hasReference(Instruction &ins) const
MoveGuard & guard() const
static CmdLineOptions * cmdLineOptions()
CodeSnippet & parent() const
PreOptimizer(InterPassData &data)
virtual bool isGPR() const
bool isSourceOperation() const
virtual SimValue value() const
void unsetSourceOperation()
virtual bool readsMemory() const
void tryToPrecalcConstantAdd(DataDependenceGraph &ddg, ProgramOperation &po)
int programOperationCount() const
int inputMoveCount() const
virtual EdgeSet inEdges(const Node &node) const
int outputMoveCount() const
ControlFlowGraph::NodeSet tryToRemoveGuardInversingOp(DataDependenceGraph &ddg, ProgramOperation &po, TTAProgram::InstructionReferenceManager *irm, ControlFlowGraph &cfg)
bool isSourceVariable() const
virtual EdgeSet outEdges(const Node &node) const
ProgramOperation & destinationOperation(unsigned int index=0) const
void addNode(MoveNode &moveNode)
virtual Operand & operand(int id) const
TTAProgram::Move & move()
InterPassData & interPassData()
Instruction & parent() const
virtual OperandType type() const
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)
ControlFlowGraph::NodeSet tryToRemoveEq(DataDependenceGraph &ddg, ProgramOperation &po, TTAProgram::InstructionReferenceManager *irm, ControlFlowGraph &cfg)
virtual Terminal * copy() const =0
virtual bool equals(const Terminal &other) const =0
Terminal & source() const
static TCEString registerName(const TTAMachine::RegisterFile &rf, int index, char delim='.')
find Finds info of the inner loops in the program
static TTAProgram::MoveGuard * createInverseGuard(const TTAProgram::MoveGuard &mg, const TTAMachine::Bus *bus=NULL)
virtual bool isImmediate() const
virtual int width() const
EdgeSet copyDepsOver(MoveNode &node, bool anti, bool raw)
MoveNode & outputMove(int index) const
static void executeProcedurePass(TTAProgram::Program &program, const TTAMachine::Machine &targetMachine, ProcedurePass &procedurePass)
void handleProgram(TTAProgram::Program &program, const TTAMachine::Machine &targetMachine)
const BasicBlockNode & getBasicBlockNode(const MoveNode &mn) const
void handleProcedure(TTAProgram::Procedure &procedure, const TTAMachine::Machine &targetMachine)
EdgeReason edgeReason() const
void setSource(Terminal *src)
void removeOutputNode(MoveNode &node, int outputIndex)
MoveNode & inputMove(int index) const