[LLVMdev] Understanding SelectionDAG construction

Eli Friedman eli.friedman at gmail.com
Mon Jun 6 02:21:19 PDT 2011


On Mon, Jun 6, 2011 at 1:54 AM, ankur deshwal <a.s.deshwal at gmail.com> wrote:
> I am trying to understand the SelectionDAG construction from LLVM IR. I have
> gone through the doc "The LLVM Target-Independent Code Generator" on LLVM
> site. This gives a great initial overview. However I am unable to catch the
> actual control flow for the llvm->selectionDag conversion.
>
> The flags "-view-sched-dags".. described in the doc doesn't seem to work. (
> "llc -help" doesn't list it ).

See http://llvm.org/docs/ProgrammersManual.html#ViewGraph ... and the
option is listed in -help-hidden.

> To understand the codeflow, I was trying to use gdb over llc. Where should I
> put the breakpoints where I can see llvm->selectionDag conversion happening
> e.g.  SDNode being generated out of llvm instructions.

Setting a breakpoint on SelectionDAGISel::SelectBasicBlock wouldn't be
a bad place to start (although most of the relevant code is actually
in SelectionDAGBuilder.cpp).

> Any pointer to detailed level doc will also help. Doxygen doesnt help till I
> am a bit familiar with Codeflow.

There really aren't any docs more detailed than the one you mentioned.

-Eli




More information about the llvm-dev mailing list