Introducing Target-Specific Constructs
So far, you have seen how the middle-end is structured and how to reuse the existing passes to create your own pass pipeline. In particular, in the previous chapter, you saw that some passes leverage some target-provided application programming interfaces (APIs) to perform their transformations. In this chapter, you will learn how to bring-up and populate this APIs to connect your target-specific information to the generic passes.
To this end, you will learn the following:
- How to add a new target to the LLVM infrastructure, including the Clang frontend
- How to add intrinsics, which are a mechanism that allows you to expose target-specific constructs at the language level (C, C++, etc.) all the way down to the backend
- How to create your own
TargetTransformInfo
sub-class, which is the API that supplies the information that controls/informs some of the middle-end optimizations - How to inject your custom passes in the...