This is an archive of the discontinued LLVM Phabricator instance.

llvm-reduce: Support running passes unconditionally and add useful manual reductions
Needs ReviewPublic

Authored by Zoxc on Feb 20 2023, 4:08 PM.

Details

Reviewers
arsenm
Summary

This adds a --reduce command line options which just runs the specified passes without using a test program or the delta algorithm.

A noise pass is added which runs other passes intended to make the LLVM IR more readable is added by removing less important details. It also runs a demangling pass.

A to-call-list pass is added which runs other passes reducing functions to only calls of non-intrinsic functions. It also removes arguments and runs the noise pass. This is useful to investigate inlining behavior.

The reduce arguments pass is changed to no longer delete instructions so that it can be reused in the to-call-list pass. I'm not sure why it previously did so, as there is a separate pass to remove instructions.

Diff Detail

Event Timeline

Zoxc created this revision.Feb 20 2023, 4:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 20 2023, 4:08 PM
Zoxc requested review of this revision.Feb 20 2023, 4:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 20 2023, 4:08 PM

All of the different points you mentioned should be split into separate patches. Also needs tests

llvm/tools/llvm-reduce/deltas/Demangle.cpp
2

Broken first line comment

llvm/tools/llvm-reduce/deltas/ReduceInstructions.cpp
100

Typo Instrinsics