Rewrite rule coverage

785 views
Skip to first unread message

Keith Randall

unread,
Apr 26, 2016, 3:52:55 PM4/26/16
to golang-dev
Josh a while ago added an option to the SSA compiler which logs every rewrite rule that's triggered.  I just hacked up a program that takes the output of that code and generates a cover-like profile of all of our rewrite rules.  Running on make.bash, you can see which rewrite rules trigger and which don't (attached).  The hope is to use this data to generate tests for the compiler that cover all the rewrite rules.  Or convince us that there are some rules that are not needed.

(Rules with *** fire, rules with --- don't)

TODO: use all.bash as the corpus, it has a lot more weird tests.
TODO: run go cover on the compiler itself, not just the rewrite rules.

AMD64-cover
generic-cover

Keith Randall

unread,
May 24, 2016, 6:42:31 PM5/24/16
to golang-dev
I've updated the SSA rewrite rule generator to record coverage data from all.bash, so we include all of our tests in the coverage data.  Not unexpectedly, coverage looks a lot better.

generic.rules: 65%
AMD64.rules: 73%
decompose.rules: 100%
decompose-cover
amd64-cover
generic-cover

Keith Randall

unread,
Jun 6, 2016, 8:07:56 PM6/6/16
to golang-dev
Rob and I got the coverage tool working on the compiler itself (running all.bash on amd64 as the test suite).  Enjoy!

There's a tool to generate these: https://github.com/randall77/compilercover
Be sure to read the top of main.go before you run the tool.
coverage.html

Keith Randall

unread,
Jun 6, 2016, 8:11:04 PM6/6/16
to golang-dev
(download and open with a browser, looks like a direct click on the attachment doesn't quite work)

Reply all
Reply to author
Forward
0 new messages