This is an archive of the discontinued LLVM Phabricator instance.

[llvm-mca] Plot as result of comparing multiple files
ClosedPublic

Authored by mmatic05 on Dec 14 2021, 3:52 AM.

Details

Summary

This patch introduces a new options for script llvm-mca-compare.py (-plot-resource-pressure, -plot) to draw plots for llvm-mca tool statistics and option (--plot-path) to specify relative path where you want to save the plots.

The new options are used as follows:

$ llvm-project/llvm/utils/llvm-mca-compare.py file1.s file2.s file3.s file4.s --llvm-mca-binary=build/bin/llvm-mca -plot

same as

$ llvm-project/llvm/utils/llvm-mca-compare.py file1.s file2.s file3.s file4.s --llvm-mca-binary=build/bin/llvm-mca -plot --plot-path=./

$ llvm-project/llvm/utils/llvm-mca-compare.py file1.s file2.s file3.s file4.s --llvm-mca-binary=build/bin/llvm-mca -plot-resource-pressure 

$ llvm-project/llvm/utils/llvm-mca-compare.py test-one-code-region.s test-two-code-regions.s --llvm-mca-binary=build/bin/llvm-mca -plot

$ llvm-project/llvm/utils/llvm-mca-compare.py test-one-code-region.s test-two-code-regions.s --llvm-mca-binary=build/bin/llvm-mca -plot-resource-pressure

Used assembly files:

Diff Detail

Unit TestsFailed

Event Timeline

mmatic05 created this revision.Dec 14 2021, 3:52 AM
mmatic05 requested review of this revision.Dec 14 2021, 3:52 AM
mmatic05 edited the summary of this revision. (Show Details)Dec 14 2021, 10:03 AM
mmatic05 updated this revision to Diff 394812.Dec 16 2021, 3:50 AM
andreadb added a comment.EditedDec 19 2021, 5:21 AM

Thanks for this patch.

I don't have a strong opinion in general.
I wonder if there is a better way to visualise resource pressure.
For example, it would be nicer and much more readable if samples contributed by different files were clustered by resource ID. Currently, it is not immediately recognisable where contributions for a resource ID end, and where contributions to the next resource start.

As a side note: what about the other patch D115138? It doesn't look like it has been committed yet.

I'm working on visualizing resource pressures on a better way. One of my colleagues will commit patch D115138 for me, thanks!

mmatic05 updated this revision to Diff 395645.Dec 21 2021, 4:39 AM
mmatic05 edited the summary of this revision. (Show Details)
  • addressed comments
mmatic05 updated this revision to Diff 395651.Dec 21 2021, 4:41 AM
djtodoro added inline comments.Dec 21 2021, 4:49 AM
llvm/utils/llvm-mca-compare.py
68

too verbose I think, I'd say:

"Draw plots of statistics for input files."

83
mmatic05 updated this revision to Diff 395875.Dec 22 2021, 8:21 AM
  • addressed comments
djtodoro accepted this revision.Dec 27 2021, 4:39 AM

lgtm, thanks!

This revision is now accepted and ready to land.Dec 27 2021, 4:39 AM

@mmatic05 Are you intending to push this to trunk?

ping.

Are there any updates on this? Any reasons why this review is still open?

It will be committed tomorrow.

This revision was landed with ongoing or failed builds.Jan 28 2022, 4:05 AM
This revision was automatically updated to reflect the committed changes.