[LLVMdev] Making Sense of ISel DAG Output

David Greene dag at cray.com
Thu Oct 2 14:15:33 PDT 2008


On Thursday 02 October 2008 15:37, Dan Gohman wrote:

> I highly recommend the viewGraph() output.  -view-isel-dags and
> -view-sched-dags show the graph before and after selection,
> respectively. See the CodeGen docs where I recently added some
> text describing all these options.

Yeah, I've been using those but they're real hard to understand with big 
graphs.

> Also, you can call viewGraph() from within a debugger, to view
> the graph at arbitrary point in the middle of the selection
> process. You can can even put a breakpoint on the Select
> function and view the graph as each individual instruction is
> selected.

That might be more helpful.  Thanks for the tip!

Which Select function are you referring to?

> It can get hairy with really large graphs, but if you're trying
> to understand instruction selection, it's often possible to reduce
> the testcases to a readable scale while still including the
> interesting parts. SelectionDAG's setGraphColor method can also
> help when graphs get large.

Unfortunately, the testcase is about as simple as it can get: a loop with a 
gather, a multiply and a store.  Maybe I can hand-whittle some IR.

> And FWIW, there are some significant improvements in the
> viewGraph() output in TOT :-).

Yeah, I saw that.  Unfortunately we won't get it until early next year, 
probably.  :(

                                               -Dave



More information about the llvm-dev mailing list