This is an archive of the discontinued LLVM Phabricator instance.

[Util] Add a helper script for converting -print-before-all output into a file based equivelent
ClosedPublic

Authored by reames on Jun 17 2019, 3:40 PM.

Details

Summary

Simple little utility which takes a opt logfile generated with -print-before-all -print-module-scope, and splits into a series of individual "chunk-X.ll" files. The intended purpose is to help automate one step in failure reduction.

The imagined workflow is:

  1. New crasher bug reported against clang or other frontend
  2. Frontend run with -emit-llvm equivalent and manually confirmed that opt -O2 <emit.ll> crashes
  3. Run this splitter script
  4. Manually map pass name to invocation command (next on the to automate list)
  5. Run bugpoint on last chunk file + manual command

I chose to dump every chunk rather than only the last since miscompile debugging frequently requires either manual step by step reduction, or cross feeding IR into different compiler versions. Not an immediate target, but there may be applications.

Diff Detail

Repository
rL LLVM

Event Timeline

reames created this revision.Jun 17 2019, 3:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 17 2019, 3:40 PM
skatkov accepted this revision.Jun 18 2019, 10:50 PM

I remember there were an idea to use git where each commit corresponds to one module output.
Have you considered this option?
It should save a lot of disk space and should not prevent you from the task you described.

utils/chunk-print-before-all.py
22 ↗(On Diff #205197)

is_dump to have uniform variable naming.

This revision is now accepted and ready to land.Jun 18 2019, 10:50 PM

I remember there were an idea to use git where each commit corresponds to one module output.
Have you considered this option?
It should save a lot of disk space and should not prevent you from the task you described.

I specifically wanted something which worked as a post process of existing output. (I believe that was the result of that proposal as well.) Taking the output of this, and creating the version history in a git repo would be straight-forward if you wanted to.

This revision was automatically updated to reflect the committed changes.