@@ -258,7 +258,8 @@ llvm::Error InOrderIssueStage::tryIssue(InstRef &IR) {
258
258
259
259
// If the instruction has a latency of 0, we need to handle
260
260
// the execution and retirement now. If the instruction is issued in multiple
261
- // cycles, we cannot retire until it is finished issuing.
261
+ // cycles, we cannot handle the instruction being executed here so we make
262
+ // updateCarriedOver responsible.
262
263
if (IS.isExecuted () && !ShouldCarryOver) {
263
264
PRF.onInstructionExecuted (&IS);
264
265
LSU.onInstructionExecuted (IR);
@@ -295,15 +296,16 @@ void InOrderIssueStage::updateIssuedInst() {
295
296
continue ;
296
297
}
297
298
298
- PRF.onInstructionExecuted (&IS);
299
- LSU.onInstructionExecuted (IR);
300
- notifyInstructionExecuted (IR);
301
- ++NumExecuted;
299
+ // Allow updateCarriedOver to handle the instruction being executed if the
300
+ // instruction takes multiple cycles to issue.
301
+ if (!CarriedOver) {
302
+ PRF.onInstructionExecuted (&IS);
303
+ LSU.onInstructionExecuted (IR);
304
+ notifyInstructionExecuted (IR);
305
+ ++NumExecuted;
302
306
303
- // Allow updateCarriedOver to retire the instruction if the instruction
304
- // takes multiple cycles to issue.
305
- if (!CarriedOver)
306
307
retireInstruction (*I);
308
+ }
307
309
308
310
std::iter_swap (I, E - NumExecuted);
309
311
}
@@ -333,9 +335,16 @@ void InOrderIssueStage::updateCarriedOver() {
333
335
else
334
336
Bandwidth -= CarryOver;
335
337
336
- // updateIssuedInst did not retireInstruction if it was carried over.
337
- if (CarriedOver.getInstruction ()->isExecuted ())
338
+ // updateIssuedInst did not handle executed if issue had carry over.
339
+ if (CarriedOver.getInstruction ()->isExecuted ()) {
340
+ PRF.onInstructionExecuted (&IS);
341
+ LSU.onInstructionExecuted (IR);
342
+ notifyEvent<HWInstructionEvent>(
343
+ HWInstructionEvent (HWInstructionEvent::Executed, IR));
344
+ LLVM_DEBUG (dbgs () << " [E] Instruction #" << IR << " is executed\n " );
345
+
338
346
retireInstruction (CarriedOver);
347
+ }
339
348
340
349
CarriedOver = InstRef ();
341
350
CarryOver = 0 ;
0 commit comments