Porting GlobalISel to A New Target — LLVM 15.0.7 documentation

# Porting GlobalISel to A New Target

There are four major classes to implement by the target:

- CallLowering — lower calls, returns, and arguments according to the ABI.

- RegisterBankInfo — describe Register Bank coverage, cross-bank copy cost, and the mapping of operands onto banks for each instruction.

- LegalizerInfo — describe what is legal, and how to legalize what isn’t.

- InstructionSelector — select generic MIR to target-specific MIR.

Additionally:

- `TargetPassConfig` — create the passes constituting the pipeline, including additional passes not included in the Core Pipeline.

# Tutorials

We’d recommend watching this tutorial from the 2017 LLVM DevMeeting which gave an overview of how to bring up a new backend in GlobalISel.