This is an archive of the discontinued LLVM Phabricator instance.

[MCA] Support carry-over instructions for in-order processors
ClosedPublic

Authored by asavonic on Mar 25 2021, 7:19 AM.

Details

Summary

Instructions that have more uops than the processor's IssueWidth are
issued in multiple cycles.

The patch fixes PR49712.

Diff Detail

Event Timeline

asavonic created this revision.Mar 25 2021, 7:19 AM
asavonic requested review of this revision.Mar 25 2021, 7:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 25 2021, 7:19 AM
andreadb accepted this revision.Mar 25 2021, 8:02 AM

LGTM modulo a few nits (see comments below).

llvm/lib/MCA/Stages/InOrderIssueStage.cpp
266–268

This check is not needed if ShouldCarryOver is true. It can be safely moved inside the the above else block (at like 261).

356–379

Please move this to a separate function. Something like updateCarriedOverInstruction() (or a similar name..).

358–360

The first assert (i.e. assert(Bandwidth > 0)) can be safely removed. IssueWidth is supposed to always be bigger than 0. You would see other problems otherwise.

The second assert (i.e. assert(CarryOver > 0)) can also be removed because, by construction, it is an impossible situation if we take that if-stmt.

You can live the third assert, but please add a string comment to it.

362–363

Nit: The [E] notation should only be used for real events.

I noticed this in previous patches too, but I didn't say anything because it was not so important. Also, those debug comments are very useful in general.

However, it would be nicer if we could use a different prefix for these new remarks; messages like this one are not strictly related to hardware events. It would be nicer if we consistently use a different char for it (maybe N - as in "Note", or R for "Remark"?) instead of E, which is supposed to be used as prefix for event-related debug messages.

375–376

Same.

This revision is now accepted and ready to land.Mar 25 2021, 8:02 AM
asavonic updated this revision to Diff 333397.Mar 25 2021, 12:52 PM
  • Refactored code, added updateCarriedOver function
  • Used a different prefix for non-event debugging messages

Thanks for the review Andrea!

llvm/lib/MCA/Stages/InOrderIssueStage.cpp
362–363

"N" as in Note sounds good.
I'll update other log messages in a separate NFC patch.

andreadb added inline comments.Mar 25 2021, 1:03 PM
llvm/lib/MCA/Stages/InOrderIssueStage.cpp
362–363

Sounds good! Thanks!

The patch LGTM

This revision was landed with ongoing or failed builds.Mar 25 2021, 2:17 PM
This revision was automatically updated to reflect the committed changes.