From 38700dadc4a6891993e66f52b22b9ead290166b0 Mon Sep 17 00:00:00 2001 From: Edgar Luque Date: Wed, 11 Dec 2024 09:40:01 -0300 Subject: [PATCH] detail --- docs/src/about.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/about.md b/docs/src/about.md index b43deb6..3595487 100644 --- a/docs/src/about.md +++ b/docs/src/about.md @@ -62,7 +62,7 @@ A function is made up of blocks, each block contains a sequence of instructions, It uses Single Static Assignment form (SSA form), which means a variable is assigned once and only once, this allows LLVM to do a lot of optimizations. Due to this, when control flow is involved, one must take care to dominate all the uses, for example you may have a target block -that has 2 predecessors (2 blocks where each ends up jumping to this target block), each of these predecessors can define variables that will be used in this target block, to "unify" those variables in the target block you must use the [phi](https://llvm.org/docs/LangRef.html#i-phi) instruction, which defines a PHI node. +that has 2 predecessors (2 blocks where each ends up jumping to this target block), each of these predecessors can define variables that will be used in this target block, to "unify" those variables (to do dependency analysis) in the target block you must use the [phi](https://llvm.org/docs/LangRef.html#i-phi) instruction, which defines a PHI node. One can avoid using PHI nodes by relying on `allocas`, a alloca is a reservation of the stack space, basically you give it a size and align and it gives you a pointer to this allocation, you can then simply load/store that pointer, from any branch and you don't have to deal with PHI nodes this way, this is what most languages do, like Rust, they rely on LLVM to later optimize the allocas into register uses whenever possible.