Target-specific elements in LLVM IR
While the core of LLVM IR is target-agnostic, target-specific constraints leak in more or less subtle ways into the IR.
In this section, we will cover some of the elements that may make running an LLVM IR program difficult from one target to another.
This knowledge can help you to investigate issues across platforms and understand the limitations of such an approach.
Let us start this list with an obvious one, the intrinsic functions.
Intrinsic functions
Intrinsic functions, or intrinsics for short, are built-in functions that map to low-level constructs, and potentially target-specific instructions.
When writing a frontend, you should aim to target the regular LLVM IR as much as possible. However, some constructs may be difficult to express, or it may be difficult to preserve the developer’s intent with only regular instructions. This is when intrinsics come in handy because they allow you to cross the frontend-backend...