[PATCH] D110908: [NPM] Automatic 'opt' pipeline reducer script.
Markus Lavin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 1 01:13:48 PDT 2021
markus created this revision.
markus added reviewers: aeubanks, bjope.
markus requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Script for automatic 'opt' pipeline reduction for when using the new
pass-manager (NPM). Based around the '-print-pipeline-passes' option.
The reduction algorithm consists of several phases (steps).
Step #0: Verify that input fails with the given pipeline and make note of the
error code.
Step #1: Split pipeline in two starting from front and move forward as long as
first pipeline exits normally and the second pipeline fails with the expected
error code. Move on to step #2 with the IR from the split point and the
pipeline from the second invocation.
Step #2: Remove passes from end of the pipeline as long as the pipeline fails
with the expected error code.
Step #3: Make several sweeps over the remaining pipeline trying to remove one
pass at a time. Repeat sweeps until unable to remove any more passes.
Usage example:
./tmp/reduce_pipeline.py --opt-binary=./build-all-Debug/bin/opt --input=input.ll --output=output.ll --passes=PIPELINE [EXTRA-OPT-ARGS ...]
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D110908
Files:
llvm/utils/pipeline.py
llvm/utils/reduce_pipeline.py
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110908.376442.patch
Type: text/x-patch
Size: 11339 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211001/900c072a/attachment.bin>
More information about the llvm-commits
mailing list