The scheduling model
In the LLVM scheduling infrastructure, the scheduling model is the piece that holds all the information about the resources of the subtarget and how they are used by the various instructions.
Note
We always speak about subtargets when talking about scheduling capabilities. This is because the scheduling capabilities are tied to the microarchitecture of your target, hence its subtarget. For instance, the scheduling capabilities of the x86 target are different for the Haswell and the Sapphire Rapids microarchitectures.
This information is described statically with TableGen and then used by the scheduling infrastructure to make decisions.
In typical LLVM fashion, there are two complementary ways to describe your scheduling model. At the core, both methods model how processor resources are used, such as the arithmetic logic unit (ALU) and load-store unit, but to simplify it, one does that in terms of scheduling events and the other in...