SelectionDAG
LLVM's classic instruction-selection framework, which turns each basic block into a directed acyclic graph and pattern-matches it against machine instructions.
Every basic block of LLVM IR becomes a DAG whose nodes are operations and whose edges are data dependencies. The graph then goes through a fixed sequence of stages: a combiner that simplifies patterns, type legalisation that breaks down types the target lacks, operation legalisation, the selection itself using matchers generated from TableGen, and finally scheduling back into a linear list of instructions.
The design has two well-known weaknesses. It sees only one basic block at a time, so patterns spanning block boundaries are missed, and it is slow — instruction selection is often among the most expensive parts of a low-optimisation build. Both are why GlobalISel was built, yet SelectionDAG remains the default for most targets.