1

I am often confused about the relationship between SelectionDAG and SelectionDAGISel, also some other related classes as SelectionDAGLowering. Understanding their relationship in the high level would be very useful.

Thomson
  • 20,586
  • 28
  • 90
  • 134

1 Answers1

2

First, I would like to give you a couple of wonderful links to read about instruction selection:

In a nutshell, SelectionDAG is a kind of internal representation with explicit instruction dependencies. It is used for instruction selection and scheduling (DAG example).

SelectionDAGISel is a pass that converts machine independent LLVM IR into machine dependent representation (MachineFunction, MachineBasicBlock, MachineInstr), i.e. the pass builds SelectionDAG and performs instruction selection and scheduling. It is subclassed by specific targets, e.g. ARMDAGToDAGISel.

SelectionDAGBuilder is a class that builds SelectionDAG from LLVM IR.

I'm not sure about SelectionDAGLowering. It seems that it's the old name for SelectionDAGBuilder class.

Community
  • 1
  • 1
Nikolai
  • 1,499
  • 12
  • 24