diff options
author | John Regehr <regehr@cs.utah.edu> | 2022-01-10 22:24:23 -0700 |
---|---|---|
committer | John Regehr <regehr@cs.utah.edu> | 2022-01-10 22:24:23 -0700 |
commit | 4eec1710c51865b47480bc63a736a3719496679d (patch) | |
tree | e2548911926aa63ccdfbb1ace52ce6b94e75b593 /llvm/tools/llvm-reduce/llvm-reduce.cpp | |
parent | 5dbbd4eeb8c47d82d3acd804d0e2961be6914b4f (diff) | |
download | llvm-4eec1710c51865b47480bc63a736a3719496679d.zip llvm-4eec1710c51865b47480bc63a736a3719496679d.tar.gz llvm-4eec1710c51865b47480bc63a736a3719496679d.tar.bz2 |
allow llvm-reduce, if asked, to run its set of passes more than once, taking longer to finish but also potentially resulting in a smaller reduced file.
Diffstat (limited to 'llvm/tools/llvm-reduce/llvm-reduce.cpp')
-rw-r--r-- | llvm/tools/llvm-reduce/llvm-reduce.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/tools/llvm-reduce/llvm-reduce.cpp b/llvm/tools/llvm-reduce/llvm-reduce.cpp index 11e3dd0..e07351a 100644 --- a/llvm/tools/llvm-reduce/llvm-reduce.cpp +++ b/llvm/tools/llvm-reduce/llvm-reduce.cpp @@ -88,6 +88,12 @@ static cl::opt<std::string> TargetTriple("mtriple", cl::desc("Set the target triple"), cl::cat(Options)); +static cl::opt<int> + MaxPassIterations("max-pass-iterations", + cl::desc("Maximum number of times to run the full set " + "of delta passes (default=1)"), + cl::init(1), cl::cat(Options)); + static codegen::RegisterCodeGenFlags CGF; void writeOutput(ReducerWorkItem &M, StringRef Message) { @@ -161,7 +167,7 @@ int main(int Argc, char **Argv) { TestRunner Tester(TestFilename, TestArguments, std::move(OriginalProgram)); // Try to reduce code - runDeltaPasses(Tester); + runDeltaPasses(Tester, MaxPassIterations); // Print reduced file to STDOUT if (OutputFilename == "-") |