Lowering the ABI with SDISel
To lower the ABI with SDISel, you must implement the four methods of your target-specific version of the TargetLowering
class that are responsible for this part of the selector. Specifically, you must implement the LowerFormalArguments
, LowerReturn
, LowerCall
, and CanLowerReturn
methods. These methods map exactly to the logic we said you would need to provide at the beginning of the Overview of the IR building section.
Concretely, as we hinted previously, the implementation of these methods will rely heavily on the CCState
and the CCValAssign
classes. More specifically, you need to use one of the CCState::AnalyzeXXX
methods with a proper CCAssignFn
instance (the one you produced with TableGen) to produce a list of CCValAssign
instances. The CCState::AnalyzeXXX
method to use depends on what you are trying to achieve:
AnalyzeFormalArguments
: Use this method when producing the sequence of instructions to read the arguments from within acallee...