initial selection DAG

Hi,

I wonder how the initial selection DAG is built in the backends.

From working backends I get:

----8<-------
Initial selection DAG: BB#0 'main:'
SelectionDAG has 18 nodes:
----8<-------

From my (not working) backend I get:

----8<-------
Initial selection DAG: BB#0 'main:'
SelectionDAG has 15 nodes:
----8<-------
I miss three nodes and I wonder what do I have to implement to get at least the right initial selection DAG?

Do I have to define all instructions in the td files first?

Cheers,
Nico

Hi Nico,

I miss three nodes and I wonder what do I have to implement to get at least the right initial selection DAG?

Most of the work is done by the files in lib/CodeGen/SelectionDAG
(first SelectionDAGBuilder.cpp, then the Legalizers and DAGCombiner) .
However, various target-specific hooks are used during the process
(the biggest handling function-calls and formal parameters). These
hooks and the data that effect them are defined in
lib/Target/XXX/XXXISelLowering.cpp

What should the nodes you're missing be doing? It's difficult to say
quite what part of ISelLowering you need to look at without knowing
that.

Do I have to define all instructions in the td files first?

No. In principle you should be able to get a fully correct selection
dag without defining a single instruction. It wouldn't be much use for
most targets, but it would exist.

Tim.

Hi,

sorry for my late reply. You were right. Something was missed in the xxxLowering.cpp.

Thank you!

Kind regards,
Nico

----- Original Nachricht ----