diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2022-11-29 16:22:16 -0500 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2023-01-11 08:58:22 -0500 |
commit | 4f575620d51032cf98424c9defafe4dfc8d66f45 (patch) | |
tree | 0aeaf09aa227404306ccbb9e1a08be791114ad04 /llvm/tools/llvm-reduce/llvm-reduce.cpp | |
parent | d7bba07526a7298c9331de031dec15daecff3503 (diff) | |
download | llvm-4f575620d51032cf98424c9defafe4dfc8d66f45.zip llvm-4f575620d51032cf98424c9defafe4dfc8d66f45.tar.gz llvm-4f575620d51032cf98424c9defafe4dfc8d66f45.tar.bz2 |
llvm-reduce: Try to kill parallel workitems once we have a result.
The current reduction logic tries to reproduce what a serial reduction
would produce, and just takes the first one that is still
interesting. We still have to wait for all others to complete though,
which at that point is just a waste.
This helps speed things up with long running reducers, which I
frequently have. e.g. for the added sleep test on my system, it took
about 8 seconds before this change and about 4 after.
https://reviews.llvm.org/D138953
Diffstat (limited to 'llvm/tools/llvm-reduce/llvm-reduce.cpp')
-rw-r--r-- | llvm/tools/llvm-reduce/llvm-reduce.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/tools/llvm-reduce/llvm-reduce.cpp b/llvm/tools/llvm-reduce/llvm-reduce.cpp index 07a04a6..8f064bc 100644 --- a/llvm/tools/llvm-reduce/llvm-reduce.cpp +++ b/llvm/tools/llvm-reduce/llvm-reduce.cpp @@ -101,7 +101,8 @@ static cl::opt<int> static codegen::RegisterCodeGenFlags CGF; -bool isReduced(ReducerWorkItem &M, const TestRunner &Test); +bool isReduced(ReducerWorkItem &M, const TestRunner &Test, + const std::atomic<bool> &Killed); /// Turn off crash debugging features /// @@ -217,7 +218,7 @@ int main(int Argc, char **Argv) { // test, rather than evaluating the source IR directly. This is for the // convenience of lit tests; the stripped out comments may have broken the // interestingness checks. - if (!isReduced(Tester.getProgram(), Tester)) { + if (!isReduced(Tester.getProgram(), Tester, std::atomic<bool>())) { errs() << "\nInput isn't interesting! Verify interesting-ness test\n"; return 1; } |