This is an archive of the discontinued LLVM Phabricator instance.

[llvm-exegesis] Refactor FunctionExecutorImpl and create factory
ClosedPublic

Authored by aidengrossman on May 20 2023, 3:36 AM.

Details

Summary

In order to better support adding in new implementations of
FunctionExecutor, this patch makes some small changes so that it is
easier to add new ones in. FunctionExecutorImpl is renamed to
InProcessFunctionExecutorImpl to better reflect how it will be placed
relative to the soon-to-be introduced subprocess executor and a new
function is created to create executors so selection can be done more
easily. In addition, a new CLI flag, -execution-mode, which can be used
to select between the different executors.

Diff Detail

Unit TestsFailed

Event Timeline

aidengrossman created this revision.May 20 2023, 3:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 20 2023, 3:36 AM
Herald added a subscriber: mstojanovic. · View Herald Transcript
aidengrossman requested review of this revision.May 20 2023, 3:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 20 2023, 3:36 AM
courbet added inline comments.May 22 2023, 12:03 AM
llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
195

A runnable configuration exists outside of how it's executed, it feels weird to have this here. Why isn't this a member of BenchmarkRunner ?

204

Why do we need Key ?

205

[nit] use switch, even if it's only one option for now, I think it's more readable for enums.

aidengrossman marked 2 inline comments as done.

Address reviewer feedback.

llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
195

Good point. I've switched it over to being a member of BenchmarkRunner.

204

I'm using a BenchmarkKey in https://reviews.llvm.org/D151025 (and touching it in some previous patches in the stack) to pass around memory annotations, and the way I have it structured currently, I pass the key to the FunctionExecutorImpl for setup. I can move this to another diff/change this around if desired.

courbet accepted this revision.May 24 2023, 12:25 AM
courbet added inline comments.
llvm/tools/llvm-exegesis/lib/BenchmarkRunner.h
128

[nit] createFunctionExecutor ?

This revision is now accepted and ready to land.May 24 2023, 12:25 AM
aidengrossman marked an inline comment as done.

Address reviewer feedback.