48 idx1_(mn1.move().destination().operationIndex()),
49 idx2_(mn2.move().destination().operationIndex()) {}
61#ifdef DEBUG_BUBBLEFISH_SCHEDULER
62 std::cerr <<
"not exactly one destop:" << trigger.
toString()
76#ifdef DEBUG_BUBBLEFISH_SCHEDULER
77 std::cerr <<
"trying to swap operand of po: "
78 << poPtr->toString() << std::endl;
83#ifdef DEBUG_BUBBLEFISH_SCHEDULER
84 std::cerr <<
"\tNot swapping with itself" << std::endl;
89#ifdef DEBUG_BUBBLEFISH_SCHEDULER
90 std::cerr <<
"\tnot commutative" << std::endl;
96 if (otherInputs.
count() != 1) {
97#ifdef DEBUG_BUBBLEFISH_SCHEDULER
98 std::cerr <<
"\tother input count not 1" << std::endl;
109#ifdef DEBUG_BUBBLEFISH_SCHEDULER
110 std::cerr <<
"\tCannot swap operand with pre-loop-shared" << std::endl;
119#ifdef DEBUG_BUBBLEFISH_SCHEDULER
120 std::cerr <<
"\tshould swap indeces: " << i <<
" and " << index
130#ifdef DEBUG_BUBBLEFISH_SCHEDULER
131 std::cerr <<
"\tother input is: " << other.
toString() << std::endl;
143#ifdef DEBUG_BUBBLEFISH_SCHEDULER
144 std::cerr <<
"Cannot swap: " <<
idx1_ <<
" and " <<
idx2_ << std::endl;
148#ifdef DEBUG_BUBBLEFISH_SCHEDULER
149 std::cerr <<
"Swapping inputs: " <<
poPtr_->toString() << std::endl;
152#ifdef DEBUG_BUBBLEFISH_SCHEDULER
153 std::cerr <<
"Swapped inputs: " <<
poPtr_->toString() << std::endl;
159#ifdef DEBUG_BUBBLEFISH_SCHEDULER
160 std::cerr <<
"undoing swap: " <<
poPtr_->toString() << std::endl;
163#ifdef DEBUG_BUBBLEFISH_SCHEDULER
164 std::cerr <<
"undid swap: " <<
poPtr_->toString() << std::endl;
std::shared_ptr< ProgramOperation > ProgramOperationPtr
TTAMachine::FUPort * isPreLoopSharedOperand(MoveNode &mn) const
BFSwapOperands(BF2Scheduler &sched, MoveNode &mn)
ProgramOperationPtr poPtr_
virtual bool operator()()
std::pair< MoveNode *, MoveNode * > switched_
virtual void undoOnlyMe()
unsigned int destinationOperationCount() const
std::string toString() const
TTAProgram::Move & move()
ProgramOperationPtr destinationOperationPtr(unsigned int index=0) const
virtual int numberOfInputs() const
virtual bool canSwap(int id1, int id2) const
Terminal & source() const
Terminal & destination() const
virtual int operationIndex() const
virtual bool isImmediate() const