diff --git a/doc/guide/src/LLVMCodegen.adoc b/doc/guide/src/LLVMCodegen.adoc index 465c94f73..e88f65694 100644 --- a/doc/guide/src/LLVMCodegen.adoc +++ b/doc/guide/src/LLVMCodegen.adoc @@ -5,8 +5,6 @@ The <> is a <> that translates the further optimized and compiled to native object code by the <> toolchain. -It requires <> version 13.0 or greater to be installed. - In benchmarks performed on the <> architecture, code size with this generator is usually slightly smaller than either the <> or the <> code generators. Compile @@ -14,6 +12,25 @@ time is worse than <>, but slightly better than <>. Run time is often better than either <> or <>. +The <> works by generating text LLVM IR (`.ll` files) and +compiling it to object code (`.o` files) using the LLVM command-line tools: +`llvm-as` (`.ll` to `.bc` assembler), `opt` (`.bc` to `.bc` optimizer), and +`llc` (`.bc` to `.o` system compiler). The `-llvm-as `, +`-llvm-opt `, and `-llvm-llc ` +<> can be used to specify the +executables to be used when invoking the LLVM command-line tools, which can be +used to select a specific version of the LLVM command-line tools (e.g., +`-llvm-as llvm-as-14 -llvm-opt opt-14 -llvm-llc llc-14`). + +<> requires LLVM 13 or 14, as it invokes `opt` +using the +https://releases.llvm.org/14.0.0/docs/ReleaseNotes.html#changes-to-the-llvm-ir:["legacy +pass manager"]. + +As of 20230522, MLton requires LLVM 14, as it invokes `opt` using the +https://releases.llvm.org/14.0.0/docs/ReleaseNotes.html#changes-to-the-llvm-ir:["new +pass manager"]. + == Implementation * https://github.com/MLton/mlton/blob/master/mlton/codegen/llvm-codegen/llvm-codegen.sig[`llvm-codegen.sig`]