Previously, bug reducer tester would just assert when it saw a direct apply to
its target function. Now we add support for also causing a miscompile by just
deleting the apply. This is tested by eliminating an apply to putchar to ensure
we are not dependent on any stdlib details.
Now once you have a pass list using:
./bug-reducer opt ...
You can take the pass list and give it and the output file to bug-reducer func:
./bug-reducer func ...
which will reduce the function list for you given a pass list. This is kept
separate to allow for testing and orthogonality. In a future commit, I am going
to add an option to ./bug-reducer opt that will invoke the function reducer
automagically.
This enables us to specify variables like module_name, sdk without having the
SILToolInvoker rely on the argument for the input_file. This is a nice
separation and will let me implement easily a func_bug_reducer tool that can be
enabled after reducing the number of functions using opt_bug_reducer.py.
Currently it supports random bug finding and opt pipeline reduction. At some
point in the future it will support:
1. Reducing of optimizer crasher test cases.
2. Reducing optimizer miscompile test cases.
But those are for another time, this is just a first step. Patches welcome = ).
Check out llvm's bugpoint for inspiration.
It also has a basic test of pass pipeline reduction that is triggered via the
validation testing in lit. One thing to note here is that the tool right now
assumes darwin. This can be fixed in the future.