For translating the LLVM IR to generic machine instructions, we only need to implement how arguments and return values are…
Instruction selection via the selection DAG produces fast code, but it takes time to do so. The speed of the…
After, we define the getSubtargetImpl() method. The sub-target instance to use depends on the target-cpu and target-features function attributes. For…
The implementation of the class is stored in the M88kTargetMachine.cpp file. Please note that we created this file in Chapter…
The instruction selection creates machine instructions, represented by the MachineInstr class, from LLVM IR. But this is not the end.…
The M88kInstrInfo class has many hook methods we can override to accomplish special tasks, for example, for branch analysis and…
One crucial part is still missing: we need to define the pass that performs the DAG transformations defined in the…
Let’s implement the M88kISelLowering class, which is stored in M88kISelLowering.cpp file, first. The constructor configures the legal types and operations:…
Creating machine instructions from the IR is a very important task in the backend. One common way to implement it…
For a calling convention, there are also more predefined conditions and actions to note. For example, CCIfInReg checks if the…