This is an archive of the discontinued LLVM Phabricator instance.

[llvm-exegesis] Initialize all supported targets
ClosedPublic

Authored by reames on Sep 9 2022, 12:42 PM.

Details

Summary

Enable registration of multiple exegesis targets at once. Use idiomatic approach to defining target select macros, but leave code in the llvm-mca sub-directories for now.

This is a stepping stone towards allowing llvm-exegesis benchmarking via simulator or testing in non-target dependent tests.

Note: I have not been able to test the analysis mode. I can't get the build system to recognize the pfm library on my build machine. As such, please double check me that the registration code which already existed appears to handle multiple registered targets correctly.

Diff Detail

Event Timeline

reames created this revision.Sep 9 2022, 12:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 9 2022, 12:42 PM
reames requested review of this revision.Sep 9 2022, 12:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 9 2022, 12:42 PM
reames planned changes to this revision.Sep 9 2022, 12:50 PM

I think I got something wrong here. Seeing something odd when building on top of this, marking as plan changes until I figure it out.

reames updated this revision to Diff 459178.Sep 9 2022, 1:06 PM

Fix a typo in cmake which resulted in no targets being listed in TargetExegesis.def and thus no targets actually registered.

As such, please double check me that the registration code which already existed appears to handle multiple registered targets correctly.

It doesn't actually (yaml parsing code needs to know the target beforehand because it parses instruction names to target-specific opcodes). I'll send a patch.

courbet added inline comments.Sep 12 2022, 7:01 AM
llvm/tools/llvm-exegesis/llvm-exegesis.cpp
443

Once D133697 is in you can add InitializeAllExegesisTargets(); here.

As such, please double check me that the registration code which already existed appears to handle multiple registered targets correctly.

It doesn't actually (yaml parsing code needs to know the target beforehand because it parses instruction names to target-specific opcodes). I'll send a patch.

Thanks.

@courbet Anything blocking this now that your change has landed?

courbet accepted this revision.Sep 22 2022, 8:40 AM
This revision is now accepted and ready to land.Sep 22 2022, 8:40 AM
This revision was landed with ongoing or failed builds.Sep 22 2022, 9:03 AM
This revision was automatically updated to reflect the committed changes.