Skip to content

Commit c7e2357

Browse files
Gang Y Chenigcbot
authored andcommitted
Changes in code.
1 parent e1395ac commit c7e2357

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

visa/G4_BB.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,6 +1208,16 @@ INST_LIST_ITER G4_BB::getFirstInsertPos() {
12081208
return II;
12091209
}
12101210

1211+
INST_LIST_ITER G4_BB::getLastInsertPos() {
1212+
INST_LIST_ITER II = begin();
1213+
for (INST_LIST_ITER IB = end(); II != IB; ++II) {
1214+
G4_INST *tI = (*II);
1215+
if (tI->isFlowControl() || tI == instList.back())
1216+
return II;
1217+
}
1218+
return II;
1219+
}
1220+
12111221

12121222
//
12131223
// Add an EOT send to the end of this BB.

visa/G4_BB.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,8 @@ class G4_BB {
308308

309309
// Return the first insert position if any; otherwise return end().
310310
INST_LIST_ITER getFirstInsertPos();
311+
// return the last insert position before terminating instruction
312+
INST_LIST_ITER getLastInsertPos();
311313

312314
void addEOTSend(G4_INST *lastInst = NULL);
313315

0 commit comments

Comments
 (0)