This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
dev:crosscompiler:ssa [2014/07/01 16:02] – external edit 127.0.0.1 | dev:crosscompiler:ssa [2016/02/25 13:33] – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Static Single Assignment Form ====== | ====== Static Single Assignment Form ====== | ||
The Static Single Assignment Form (SSA) is an intermediate form which allows various optimizations and facilitates register allocation. The main point of the SSA is that each variable is assigned a value only once. Each new assignment leads to a new instance of this variable (indicated by i< | The Static Single Assignment Form (SSA) is an intermediate form which allows various optimizations and facilitates register allocation. The main point of the SSA is that each variable is assigned a value only once. Each new assignment leads to a new instance of this variable (indicated by i< | ||
- | When optimizing, subsequent instuctions can simply use the definition and the value of these variables (e.g. for constant folding). The register allocation can be made more efficient as the living ranges of the instances are generally very short. More information about the creation and usage of the SSA can be found in [[literatur: | + | When optimizing, subsequent instuctions can simply use the definition and the value of these variables (e.g. for constant folding). The register allocation can be made more efficient as the living ranges of the instances are generally very short. More information about the creation and usage of the SSA can be found in [[http:// |
The SSA is stored into nodes similar to the CFG nodes. For this purpose we define SSANode as an extension of CFGNode. | The SSA is stored into nodes similar to the CFG nodes. For this purpose we define SSANode as an extension of CFGNode. | ||
[{{ .: | [{{ .: | ||
When generating the CFG we already create instances of type SSANode. | When generating the CFG we already create instances of type SSANode. | ||
- | |||
===== SSA Instructions ===== | ===== SSA Instructions ===== | ||
All Bytecode instructions of all nodes are translated into SSA instructions. The SSA instructions can be categorized as follows: | All Bytecode instructions of all nodes are translated into SSA instructions. The SSA instructions can be categorized as follows: |