68 int variableDstCount = 0;
69 bool bypassed =
false;
74 std::map<MoveNode*, bool, MoveNode::Comparator> bypassDestinations;
76 int earliestDst = INT_MAX;
78 for (
auto i : rrDestinations) {
80 int guardParam = i.first->guardUse() ? 1 : 2;
88 onlyRegisterRawSource(*n, guardParam) == NULL) {
93 if (guardParam == 2) {
98 src_, destinationPorts)) {
101 rm()).initiationInterval() != 0)) {
105 #ifdef DEBUG_BUBBLEFISH_SCHEDULER
106 std::cerr <<
"\t\tFound ok bypass dest: " << n->
toString()
110 if (!
ddg().guardsAllowBypass(
src_, *n)) {
111 #ifdef DEBUG_BUBBLEFISH_SCHEDULER
112 std::cerr <<
"\t\tGuards do not allow bypass to: "
119 int originalCycle = n->
cycle();
121 if (
lc_ < earliestLimit) {
122 #ifdef DEBUG_BUBBLEFISH_SCHEDULER
123 std::cerr <<
"\t\t\tcycle limites prevent late bypass "
128 earliestDst = std::min(earliestDst, originalCycle);
129 bypassDestinations.insert(std::make_pair(n,
false));
135 int originalCycle = n->
cycle();
137 if (
lc_ < earliestLimit) {
138 #ifdef DEBUG_BUBBLEFISH_SCHEDULER
139 std::cerr <<
"\t\t\tcycle limites prevent late bypass "
144 earliestDst = std::min(earliestDst, originalCycle);
145 bypassDestinations.insert(std::make_pair(n,
true));
150 for (
auto n : bypassDestinations) {
151 if (n.first->cycle() == earliestDst) {
158 n.first->isDestinationVariable() &&
159 variableDstCount>0) {
167 if (n.first->isDestinationVariable()) {
171 bypassDestinations.erase(n.first);
174 #ifdef DEBUG_BUBBLEFISH_SCHEDULER
175 std::cerr <<
"\nAttempting guard bypass from: " <<
184 #ifdef DEBUG_BUBBLEFISH_SCHEDULER
185 std::cerr <<
"\tguard bypass ok." << std::endl;
187 std::cerr <<
"\tGuard bypass failed." << std::endl;
190 bypassDestinations.erase(n.first);
197 for (
auto n : bypassDestinations) {
203 n.first->isDestinationVariable() &&
204 variableDstCount>0) {
208 int originalCycle = n.first->cycle();
215 if (n.first->isDestinationVariable()) {
231 if (variableDstCount == 0) {
234 assert(variableDstCount == 1);
250 #ifdef DEBUG_BUBBLEFISH_SCHEDULER
251 std::cerr <<
"DRE ok!" << std::endl;
253 std::cerr <<
"Could not DRE away: " <<
src_.
toString() << std::endl;