This is an archive of the discontinued LLVM Phabricator instance.

[llvm-exegesis] Dry run mode
ClosedPublic

Authored by lebedev.ri on Dec 6 2022, 11:34 AM.

Details

Summary

Sometimes we only want to ensure that we can produce snippets (all the way
through SnippetRepetitor!), but don't care for the execution.
E.g. all of our tests are this way.

I've built LLVM without PFM and removed my CPU from X86PfmCounters.td,
and this produces the expected results in that configuration.

Diff Detail

Event Timeline

lebedev.ri created this revision.Dec 6 2022, 11:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 6 2022, 11:34 AM
lebedev.ri requested review of this revision.Dec 6 2022, 11:34 AM

Adjust two more error messages to hint towards --dry-run.

lebedev.ri updated this revision to Diff 480647.Dec 6 2022, 3:13 PM

And actually deal with cross-targeting.
X86 tests should now run (and pass) on all arches.

lebedev.ri updated this revision to Diff 480673.Dec 6 2022, 4:09 PM

Ok, now for real.
The PowerPC test passes for me, and i've ensured that X86 tests pass with different defaults.

courbet added inline comments.Dec 7 2022, 1:14 AM
llvm/tools/llvm-exegesis/lib/BenchmarkRunner.h
39

Instead of plumbing BenchmarkDryRun inside this class, why can't we just not create a BenchmarkRunner at all in llvm-exegesis.cpp when the flag is true ?

lebedev.ri marked an inline comment as done.Dec 7 2022, 6:26 AM
lebedev.ri added inline comments.
llvm/tools/llvm-exegesis/lib/BenchmarkRunner.h
39

Because that, by definition, does not do what i want it to do.
I want BenchmarkRunner::runConfiguration() to get called
up to and including actually assembling the final code that we'd measure
in for (const std::unique_ptr<const SnippetRepetitor> &Repetitor : Repetitors) {.

courbet added inline comments.Dec 7 2022, 6:38 AM
llvm/tools/llvm-exegesis/lib/BenchmarkRunner.h
39

Right, I read too fast. Then le'ts rename BenchmarkDryRun to PerformMeasurements, to avoid the terminology conflict between the "Run" in "BenchmarkRunner" and "Run" in "BenchmarkDryRun". In the former, "Run" means "generate snippet and measure", in the latter it means "measure".

lebedev.ri updated this revision to Diff 480923.Dec 7 2022, 8:12 AM
lebedev.ri marked 2 inline comments as done.

Addressing review notes, thanks!

courbet accepted this revision.Dec 7 2022, 8:53 AM
This revision is now accepted and ready to land.Dec 7 2022, 8:53 AM

@courbet thank you for the review!

This revision was landed with ongoing or failed builds.Dec 7 2022, 9:16 AM
This revision was automatically updated to reflect the committed changes.

As a result of this change, the X86 tests are being run on other hosts e.g. SystemZ. Was this intended?

llvm/test/tools/llvm-exegesis/X86/uops/uops-XCHG64rr.s