This is an archive of the discontinued LLVM Phabricator instance.

SelectionDAG: add a -filter-view-dags=<string> cmd line option
ClosedPublic

Authored by mehdi_amini on Jan 12 2015, 10:07 PM.

Details

Summary

When debugging SelectionDAG on an IR with many basic blocks, It is painful to have to generate the graphviz for the 99 first blocks when you are interested in the 100.
This patch add a string parameter that allows to filter the "block of interest".

Diff Detail

Event Timeline

mehdi_amini retitled this revision from to SelectionDAG: add a -filter-view-dags=<int> cmd line option.
mehdi_amini updated this object.
mehdi_amini edited the test plan for this revision. (Show Details)
mehdi_amini added a reviewer: resistor.
mehdi_amini set the repository for this revision to rL LLVM.
resistor edited edge metadata.Jan 12 2015, 10:13 PM

What about the idea of filtering by name rather than by number? The problem with filtering by number is that it depends on you already knowing what number block you want to visualize.

mehdi_amini retitled this revision from SelectionDAG: add a -filter-view-dags=<int> cmd line option to SelectionDAG: add a -filter-view-dags=<string> cmd line option.
mehdi_amini updated this object.
mehdi_amini edited edge metadata.
mehdi_amini removed rL LLVM as the repository for this revision.

Update to use a sting and match it the BB name.

mehdi_amini added a subscriber: Unknown Object (MLST).Jan 12 2015, 10:52 PM

+llvm-commit

I don't have a strong opinion between string and number. Number is less messy and you always get them at the MI level or in SelectionDAG, on the other hand string matches the IR so is probably more convenient if you start from there.
I updated with the string version.

MatzeB added a subscriber: MatzeB.Jan 13 2015, 9:30 AM

My 2cents: In another compiler I worked with this simply worked by creating several files on the harddrive. This required you to start the viewer manually but was way more convenient when switching back and forth between different functions and phases of the compilation...

Yeah I was also thinking about such an option, but it seems orthogonal to the option I implemented here IMO.

Mehdi

Looks fine to me otherwise.

lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
188

Shouldn't it be "view-*-dags"?

This revision was automatically updated to reflect the committed changes.