This is an archive of the discontinued LLVM Phabricator instance.

[llvm-mca] Simplify eventing by adding an onEvent templated method.
ClosedPublic

Authored by mattd on Jun 27 2018, 2:15 PM.

Details

Summary

This patch eliminates some redundancy in iterating across Listeners for the
Instruction and Stall HWEvents, by introducing a template onEvent routine.
This change was suggested by @courbet in https://reviews.llvm.org/D48576. I
hope that this patch addresses that suggestion appropriately. I do like this
change better than what we had previously.

Diff Detail

Repository
rL LLVM

Event Timeline

mattd created this revision.Jun 27 2018, 2:15 PM
courbet accepted this revision.Jun 28 2018, 12:26 AM

Thanks !

tools/llvm-mca/Stage.h
59 ↗(On Diff #153174)

This can now be const.

This revision is now accepted and ready to land.Jun 28 2018, 12:26 AM
andreadb accepted this revision.Jul 12 2018, 2:53 AM

Sorry. I completely forgot about this patch.

I like this approach (thanks @courbet for suggesting it!).

LGTM too.

This revision was automatically updated to reflect the committed changes.