[all-commits] [llvm/llvm-project] 91d15a: [NPM] Automatic 'opt' pipeline reducer script.

elavkje via All-commits all-commits at lists.llvm.org
Wed Oct 6 00:11:10 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 91d15aa0b8bff10bd1ccf279418560d17fea52ff
      https://github.com/llvm/llvm-project/commit/91d15aa0b8bff10bd1ccf279418560d17fea52ff
  Author: Markus Lavin <markus.lavin at ericsson.com>
  Date:   2021-10-06 (Wed, 06 Oct 2021)

  Changed paths:
    A llvm/utils/pipeline.py
    A llvm/utils/reduce_pipeline.py
    A llvm/utils/reduce_pipeline_test/fake_opt.py
    A llvm/utils/reduce_pipeline_test/test.py

  Log Message:
  -----------
  [NPM] Automatic 'opt' pipeline reducer script.

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:
./utils/reduce_pipeline.py --opt-binary=./build-all-Debug/bin/opt --input=input.ll --output=output.ll --passes=PIPELINE [EXTRA-OPT-ARGS ...]

Differential Revision: https://reviews.llvm.org/D110908




More information about the All-commits mailing list