main

help

Click on a value or block to toggle highlighting of that value/block and its uses. (Values and blocks are highlighted by ID, and IDs of dead items may be reused, so not all highlights necessarily correspond to the clicked item.)

Faded out values and blocks are dead code that has not been eliminated.

Values printed in italics have a dependency cycle.

CFG: Dashed edge is for unlikely branches. Blue color is for backward edges. Edge with a dot means that this edge follows the order in which blocks were laidout.

start

  • b1:
    • v1 (?) = InitMem <mem>
    • v2 (?) = SP <uintptr>
    • v3 (?) = SB <uintptr>
    • v4 (?) = Addr <*uint8> {type.string} v3
    • v5 (?) = Addr <*string> {"".statictmp_0} v3
    • v6 (6) = IMake <interface {}> v4 v5 (~arg0[interface {}])
    • v7 (?) = ConstInterface <interface {}>
    • v8 (?) = ArrayMake1 <[1]interface {}> v7
    • v9 (6) = VarDef <mem> {.autotmp_9} v1
    • v10 (6) = LocalAddr <*[1]interface {}> {.autotmp_9} v2 v9
    • v11 (6) = Store <mem> {[1]interface {}} v10 v8 v9
    • v12 (6) = LocalAddr <*[1]interface {}> {.autotmp_9} v2 v11
    • v13 (6) = NilCheck <void> v12 v11
    • v14 (?) = Const64 <int> [0] (fmt.n[int])
    • v15 (?) = Const64 <int> [1]
    • v16 (6) = PtrIndex <*interface {}> v12 v14
    • v17 (6) = Store <mem> {interface {}} v16 v6 v11
    • v18 (6) = NilCheck <void> v12 v17
    • v19 (6) = IsSliceInBounds <bool> v14 v15
    • v24 (?) = ConstInterface <error> (fmt.err[error])
    • v27 (?) = OffPtr <*io.Writer> [0] v2
    • v28 (?) = Addr <*uint8> {go.itab.*os.File,io.Writer} v3
    • v29 (?) = Addr <**os.File> {os.Stdout} v3
    • v33 (?) = OffPtr <*[]interface {}> [16] v2
    • v36 (?) = OffPtr <*int> [40] v2
    • v38 (?) = OffPtr <*error> [48] v2
  • If v19b2 b3 (likely) (6)
  • b2: ← b1
    • v22 (6) = Sub64 <int> v15 v14
    • v23 (6) = SliceMake <[]interface {}> v12 v22 v22 (fmt.a[[]interface {}])
    • v25 (6) = Copy <mem> v17
    • v26 (6) = InlMark <void> [0] v25
    • v30 (275) = Load <*os.File> v29 v25
    • v31 (275) = IMake <io.Writer> v28 v30
    • v32 (275) = Store <mem> {io.Writer} v27 v31 v25
    • v34 (275) = Store <mem> {[]interface {}} v33 v23 v32
    • v35 (275) = StaticCall <mem> {fmt.Fprintln} [64] v34
    • v37 (6) = Load <int> v36 v35 (fmt.n[int])
    • v39 (6) = Load <error> v38 v35 (fmt.err[error])
  • Plainb4 (+6)
  • b3: ← b1
    • v20 (6) = Copy <mem> v17
    • v21 (6) = StaticCall <mem> {runtime.panicslice} v20
  • Exit v21 (6)
  • b4: ← b2
    • v40 (7) = Copy <mem> v35
  • Ret v40
  • name ~arg0[interface {}]: v6
  • name fmt.a[[]interface {}]: v23
  • name fmt.n[int]: v14 v37
  • name fmt.err[error]: v24 v39
  • opt [327206 ns]

    • b1:
      • v1 (?) = InitMem <mem>
      • v2 (?) = SP <uintptr>
      • v3 (?) = SB <uintptr>
      • v4 (?) = Addr <*uint8> {type.string} v3
      • v5 (?) = Addr <*string> {"".statictmp_0} v3
      • v6 (+6) = IMake <interface {}> v4 v5 (~arg0[interface {}])
      • v9 (6) = VarDef <mem> {.autotmp_9} v1
      • v10 (6) = LocalAddr <*[1]interface {}> {.autotmp_9} v2 v9
      • v14 (?) = Const64 <int> [0] (fmt.n[int])
      • v15 (?) = Const64 <int> [1]
      • v19 (6) = ConstBool <bool> [true]
      • v27 (?) = OffPtr <*io.Writer> [0] v2
      • v28 (?) = Addr <*uint8> {go.itab.*os.File,io.Writer} v3
      • v29 (?) = Addr <**os.File> {os.Stdout} v3
      • v33 (?) = OffPtr <*[]interface {}> [16] v2
      • v40 (?) = ConstNil <uintptr>
      • v20 (?) = ConstNil <*uint8>
      • v39 (6) = Const64 <int> [0]
      • v37 (6) = Const64 <int> [16]
      • v7 (?) = IMake <interface {}> v40 v20
      • v8 (?) = ArrayMake1 <[1]interface {}> v7
      • v11 (6) = Store <mem> {interface {}} v10 v7 v9
      • v12 (6) = LocalAddr <*[1]interface {}> {.autotmp_9} v2 v11
      • v13 (6) = NilCheck <void> v12 v11
      • v16 (6) = OffPtr <*interface {}> [0] v12
      • v17 (6) = Store <mem> {interface {}} v16 v6 v11
      • v18 (6) = NilCheck <void> v12 v17
    • Firstb2 b3 (likely) (6)
    • b2: ← b1
      • v22 (6) = Const64 <int> [1]
      • v23 (+6) = SliceMake <[]interface {}> v12 v22 v22 (fmt.a[[]interface {}])
      • v26 (6) = InlMark <void> [0] v17
      • v30 (+275) = Load <*os.File> v29 v17
      • v31 (275) = IMake <io.Writer> v28 v30
      • v32 (275) = Store <mem> {io.Writer} v27 v31 v17
      • v34 (275) = Store <mem> {[]interface {}} v33 v23 v32
      • v35 (275) = StaticCall <mem> {fmt.Fprintln} [64] v34
    • Plainb4 (+6)
    • b3: ← b1
      • v21 (+6) = StaticCall <mem> {runtime.panicslice} v17
    • Exit v21 (6)
    • b4: ← b2
    • Ret v35
  • name ~arg0[interface {}]: v6
  • name fmt.a[[]interface {}]: v23
  • name fmt.n[int]: v14
  • lower [11770 ns]

    • b4:
      • v2 (?) = SP <uintptr>
      • v3 (?) = SB <uintptr>
      • v4 (?) = LEAQ <*uint8> {type.string} v3 (~arg0.type[uintptr])
      • v5 (?) = LEAQ <*string> {"".statictmp_0} v3 (~arg0.data[*uint8])
      • v15 (?) = MOVQconst <int> [1] (a.len[int], a.cap[int])
      • v28 (?) = LEAQ <*uint8> {go.itab.*os.File,io.Writer} v3
      • v29 (?) = LEAQ <**os.File> {os.Stdout} v3
      • v33 (?) = LEAQ <*[]interface {}> [16] v2
      • v40 (?) = MOVQconst <uintptr> [0]
      • v20 (?) = MOVQconst <*uint8> [0]
      • v1 (?) = InitMem <mem>
      • v9 (6) = VarDef <mem> {.autotmp_9} v1
      • v10 (6) = LEAQ <*[1]interface {}> {.autotmp_9} v2
      • v12 (6) = LEAQ <*[1]interface {}> {.autotmp_9} v2 (a.ptr[*interface {}])
      • v16 (+6) = LEAQ <*interface {}> {.autotmp_9} v2
      • v18 (6) = LEAQ <**uint8> {.autotmp_9} [8] v2
      • v21 (6) = LEAQ <**uint8> {.autotmp_9} [8] v2
      • v37 (275) = LEAQ <**uint8> [8] v2
      • v19 (275) = LEAQ <*int> [32] v2
      • v8 (275) = LEAQ <*int> [24] v2
      • v31 (6) = MOVOconst <int128> [0]
      • v11 (6) = MOVOstore <mem> {.autotmp_9} v2 v31 v9
      • v22 (6) = MOVQstore <mem> {.autotmp_9} v2 v4 v11
      • v17 (6) = MOVQstore <mem> {.autotmp_9} [8] v2 v5 v22
      • v26 (6) = InlMark <void> [0] v17
      • v30 (+275) = MOVQload <*os.File> {os.Stdout} v3 v17
      • v39 (275) = MOVQstore <mem> v2 v28 v17
      • v32 (275) = MOVQstore <mem> [8] v2 v30 v39
      • v25 (275) = MOVQstore <mem> [16] v2 v12 v32
      • v14 (275) = MOVQstoreconst <mem> [val=1,off=24] v2 v25
      • v34 (275) = MOVQstoreconst <mem> [val=1,off=32] v2 v14
      • v35 (275) = CALLstatic <mem> {fmt.Fprintln} [64] v34
    • Ret v35
  • name ~arg0.type[uintptr]: v4
  • name ~arg0.data[*uint8]: v5
  • name a.ptr[*interface {}]: v12
  • name a.len[int]: v15
  • name a.cap[int]: v15
  • regalloc [33282 ns]

    • b4:
      • v1 (?) = InitMem <mem>
      • v9 (6) = VarDef <mem> {.autotmp_9} v1
      • v2 (?) = SP <uintptr> : SP
      • v8 (6) = MOVOconst <int128> [0] : X0
      • v11 (6) = MOVOstore <mem> {.autotmp_9} v2 v8 v9
      • v3 (?) = SB <uintptr> : SB
      • v19 (6) = LEAQ <*uint8> {type.string} v3 : AX
      • v22 (+6) = MOVQstore <mem> {.autotmp_9} v2 v19 v11
      • v37 (6) = LEAQ <*string> {"".statictmp_0} v3 : AX
      • v17 (6) = MOVQstore <mem> {.autotmp_9} [8] v2 v37 v22
      • v26 (6) = InlMark <void> [0] v17
      • v30 (+275) = MOVQload <*os.File> {os.Stdout} v3 v17 : AX
      • v21 (275) = LEAQ <*uint8> {go.itab.*os.File,io.Writer} v3 : CX
      • v39 (275) = MOVQstore <mem> v2 v21 v17
      • v32 (275) = MOVQstore <mem> [8] v2 v30 v39
      • v18 (275) = LEAQ <*[1]interface {}> {.autotmp_9} v2 : AX
      • v25 (275) = MOVQstore <mem> [16] v2 v18 v32
      • v14 (275) = MOVQstoreconst <mem> [val=1,off=24] v2 v25
      • v34 (275) = MOVQstoreconst <mem> [val=1,off=32] v2 v14
      • v35 (275) = CALLstatic <mem> {fmt.Fprintln} [64] v34
    • Ret v35
  • name ~arg0.type[uintptr]: v4
  • name ~arg0.data[*uint8]: v5
  • genssa

    # /tmp/ssa-sample/main.go
    00000 (5) TEXT "".main(SB), ABIInternal
    00001 (5) FUNCDATA $0, gclocals·69c1753bd5f81501d95132d08af04464(SB)
    00002 (5) FUNCDATA $1, gclocals·568470801006e5c0dc3947ea998fe279(SB)
    00003 (5) FUNCDATA $3, gclocals·bfec7e55b3f043d1941c093912808913(SB)
    00004 (5) FUNCDATA $4, "".main.stkobj(SB)
    v8
    00005 (+6) PCDATA $2, $0
    v8
    00006 (+6) PCDATA $0, $1
    v8
    00007 (+6) XORPS X0, X0
    v11
    00008 (6) MOVUPS X0, ""..autotmp_9-16(SP)
    v19
    00009 (6) PCDATA $2, $1
    v19
    00010 (6) LEAQ type.string(SB), AX
    v22
    00011 (6) PCDATA $2, $0
    v22
    00012 (6) MOVQ AX, ""..autotmp_9-16(SP)
    v37
    00013 (6) PCDATA $2, $1
    v37
    00014 (6) LEAQ "".statictmp_0(SB), AX
    v17
    00015 (6) PCDATA $2, $0
    v17
    00016 (6) MOVQ AX, ""..autotmp_9-8(SP)
    v26
    00017 (6) XCHGL AX, AX
    # $GOROOT/src/fmt/print.go
    v30
    00018 (+275) PCDATA $2, $1
    v30
    00019 (+275) MOVQ os.Stdout(SB), AX
    v21
    00020 (275) PCDATA $2, $2
    v21
    00021 (275) LEAQ go.itab.*os.File,io.Writer(SB), CX
    v39
    00022 (275) PCDATA $2, $1
    v39
    00023 (275) MOVQ CX, (SP)
    v32
    00024 (275) PCDATA $2, $0
    v32
    00025 (275) MOVQ AX, 8(SP)
    v18
    00026 (275) PCDATA $2, $1
    v18
    00027 (275) PCDATA $0, $0
    v18
    00028 (275) LEAQ ""..autotmp_9-16(SP), AX
    v25
    00029 (275) PCDATA $2, $0
    v25
    00030 (275) MOVQ AX, 16(SP)
    v14
    00031 (275) MOVQ $1, 24(SP)
    v34
    00032 (275) MOVQ $1, 32(SP)
    v35
    00033 (275) CALL fmt.Fprintln(SB)
    b4
    00034 (?) RET
    00035 (?) END