----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?
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.