When you look into how Rust is compiled, the name LLVM comes up.
Here, I will compare it with Clang and GCC, familiar from C and C++, to clarify LLVM's role and see what rustc delegates to LLVM .
LLVM is infrastructure for building compilers
LLVM is not the name of a programming language. It is a collection of reusable components and technologies for building compilers and related tools. See the official LLVM overview .
The name LLVM can refer to the entire project or to its optimization and code generation infrastructure. When we say that Rust compilation "passes code to LLVM," we mainly mean the latter.
That includes tasks such as transforming a calculation into a more efficient form and selecting instructions for ARM64 or x86-64. Language implementations can share this infrastructure instead of building those parts from scratch.
LLVM IR, on the other hand, is a language used during compilation. IR stands for Intermediate Representation.β¦