Go: generation of Static Single Assignment

Static single assignment form

In compiler design, static single assignment form (often abbreviated as SSA form or simply SSA) is a property of an intermediate representation (IR), which requires that each variable is assigned exactly once, and every variable is defined before it is used. Existing variables in the original IR are split into versions, new variables typically indicated by the original name with a subscript in textbooks, so that every definition gets its own version. In SSA form, use-def chains are explicit and each contains a single element.

Detail info


package main

import "fmt"

func main() {
	fmt.Println("Hello, World!")

The SSA code can be generate:

GOSSAFUNC=main go tool compile main.go && open ssa.html
Publikováno v Go