This is an archive of the discontinued LLVM Phabricator instance.

[llvm-mca] Register listeners with the Stage instances.
AbandonedPublic

Authored by mattd on May 23 2018, 7:39 PM.

Details

Summary

This is an intermediate patch for moving the notification/eventing from the backend into the individual stages.
For now, the simplest approach, to put us on the right path, is to use the Backend::addEventListener to register
listeners for all stages. In the future a listener will be able to listen for events from a particular stage.

For now, we still need to maintain a list of listeners in the backend to handle events from MCA components that are not
yet stages, and to handle the cycleBegin and cycleEnd events. With this in place we can start to remove the Owner
pointers from stages that use the Owner for event dispatch. Stages should start to handle that now.

Diff Detail

Event Timeline

mattd created this revision.May 23 2018, 7:39 PM
mattd added inline comments.May 23 2018, 7:42 PM
tools/llvm-mca/Backend.h
62

When we get stages for all of the components in MCA, this will become a unique_ptr<Stage> and we can remove the explicit references to Fetch, Dispatch above. A pipeline should operates as a composable sequence of stages.

Hi Matt,

This patch looks good. However, the code will have to change again once the RetireStage and the ExecuteStage are available.

So, if you don't mind, I think it is better if we keep this patch on hold for now.
Today, I have reviewed (and accepted) the patch that introduces the RetireStage.
Once we have the ExecuteStage, then we can revisit this patch. What do you think?

Thanks,
-Andrea

mattd added a comment.May 25 2018, 9:11 AM

Hi Matt,

This patch looks good. However, the code will have to change again once the RetireStage and the ExecuteStage are available.

So, if you don't mind, I think it is better if we keep this patch on hold for now.
Today, I have reviewed (and accepted) the patch that introduces the RetireStage.
Once we have the ExecuteStage, then we can revisit this patch. What do you think?

I completely agree.

mattd abandoned this revision.Jun 25 2018, 4:48 PM