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> [8] v2
    • v28 (?) = Addr <*uint8> {go.itab.*os.File,io.Writer} v3
    • v29 (?) = Addr <**os.File> {os.Stdout} v3
    • v33 (?) = OffPtr <*[]interface {}> [24] v2
    • v36 (?) = OffPtr <*int> [48] v2
    • v38 (?) = OffPtr <*error> [56] 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 [21235 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> [8] v2
      • v28 (?) = Addr <*uint8> {go.itab.*os.File,io.Writer} v3
      • v29 (?) = Addr <**os.File> {os.Stdout} v3
      • v33 (?) = OffPtr <*[]interface {}> [24] 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 [9701 ns]

    • b4:
      • v2 (?) = SP <uintptr>
      • v3 (?) = SB <uintptr>
      • v4 (?) = MOVDaddr <*uint8> {type.string} v3 (~arg0.type[uintptr])
      • v5 (?) = MOVDaddr <*string> {"".statictmp_0} v3 (~arg0.data[*uint8])
      • v15 (?) = MOVDconst <int> [1] (a.len[int], a.cap[int])
      • v27 (?) = MOVDaddr <*io.Writer> [8] v2
      • v28 (?) = MOVDaddr <*uint8> {go.itab.*os.File,io.Writer} v3
      • v29 (?) = MOVDaddr <**os.File> {os.Stdout} v3
      • v33 (?) = MOVDaddr <*[]interface {}> [24] v2
      • v40 (?) = MOVDconst <uintptr> [0]
      • v20 (?) = MOVDconst <*uint8> [0]
      • v1 (?) = InitMem <mem>
      • v9 (6) = VarDef <mem> {.autotmp_9} v1
      • v10 (6) = MOVDaddr <*[1]interface {}> {.autotmp_9} v2
      • v11 (6) = MOVQstorezero <mem> {.autotmp_9} v2 v9
      • v12 (6) = MOVDaddr <*[1]interface {}> {.autotmp_9} v2 (a.ptr[*interface {}])
      • v16 (+6) = MOVDaddr <*interface {}> {.autotmp_9} v2
      • v18 (6) = MOVDaddr <**uint8> {.autotmp_9} [8] v2
      • v21 (6) = MOVDaddr <**uint8> {.autotmp_9} [8] v2
      • v22 (6) = MOVDstore <mem> {.autotmp_9} v2 v4 v11
      • v37 (275) = MOVDaddr <**uint8> [16] v2
      • v19 (275) = MOVDaddr <*int> [40] v2
      • v8 (275) = MOVDaddr <*int> [32] v2
      • v17 (6) = MOVDstore <mem> {.autotmp_9} [8] v2 v5 v22
      • v26 (6) = InlMark <void> [0] v17
      • v30 (+275) = MOVDload <*os.File> {os.Stdout} v3 v17
      • v39 (275) = MOVDstore <mem> [8] v2 v28 v17
      • v32 (275) = MOVDstore <mem> [16] v2 v30 v39
      • v25 (275) = MOVDstore <mem> [24] v2 v12 v32
      • v14 (275) = MOVDstore <mem> [32] v2 v15 v25
      • v34 (275) = MOVDstore <mem> [40] v2 v15 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 [25685 ns]

    • b4:
      • v1 (?) = InitMem <mem>
      • v9 (6) = VarDef <mem> {.autotmp_9} v1
      • v2 (?) = SP <uintptr> : SP
      • v11 (6) = MOVQstorezero <mem> {.autotmp_9} v2 v9
      • v3 (?) = SB <uintptr> : SB
      • v8 (6) = MOVDaddr <*uint8> {type.string} v3 : R0
      • v22 (+6) = MOVDstore <mem> {.autotmp_9} v2 v8 v11
      • v19 (6) = MOVDaddr <*string> {"".statictmp_0} v3 : R0
      • v17 (6) = MOVDstore <mem> {.autotmp_9} [8] v2 v19 v22
      • v26 (6) = InlMark <void> [0] v17
      • v30 (+275) = MOVDload <*os.File> {os.Stdout} v3 v17 : R0
      • v37 (275) = MOVDaddr <*uint8> {go.itab.*os.File,io.Writer} v3 : R1
      • v39 (275) = MOVDstore <mem> [8] v2 v37 v17
      • v32 (275) = MOVDstore <mem> [16] v2 v30 v39
      • v21 (275) = MOVDaddr <*[1]interface {}> {.autotmp_9} v2 : R0
      • v25 (275) = MOVDstore <mem> [24] v2 v21 v32
      • v18 (275) = MOVDconst <int> [1] : R0
      • v14 (275) = MOVDstore <mem> [32] v2 v18 v25
      • v34 (275) = MOVDstore <mem> [40] v2 v18 v14
      • v35 (275) = CALLstatic <mem> {fmt.Fprintln} [64] v34
    • Ret v35
  • name ~arg0.type[uintptr]: v4
  • name ~arg0.data[*uint8]: v5
  • name a.len[int]: v15
  • name a.cap[int]: v15
  • 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)
    v11
    00005 (+6) PCDATA $2, $0
    v11
    00006 (+6) PCDATA $0, $1
    v11
    00007 (+6) STP (ZR, ZR), ""..autotmp_9-16(RSP)
    v8
    00008 (6) PCDATA $2, $1
    v8
    00009 (6) MOVD $type.string(SB), R0
    v22
    00010 (6) PCDATA $2, $0
    v22
    00011 (6) MOVD R0, ""..autotmp_9-16(RSP)
    v19
    00012 (6) PCDATA $2, $1
    v19
    00013 (6) MOVD $"".statictmp_0(SB), R0
    v17
    00014 (6) PCDATA $2, $0
    v17
    00015 (6) MOVD R0, ""..autotmp_9-8(RSP)
    v26
    00016 (6) HINT $0
    # $GOROOT/src/fmt/print.go
    v30
    00017 (+275) PCDATA $2, $1
    v30
    00018 (+275) MOVD os.Stdout(SB), R0
    v37
    00019 (275) PCDATA $2, $2
    v37
    00020 (275) MOVD $go.itab.*os.File,io.Writer(SB), R1
    v39
    00021 (275) PCDATA $2, $1
    v39
    00022 (275) MOVD R1, 8(RSP)
    v32
    00023 (275) PCDATA $2, $0
    v32
    00024 (275) MOVD R0, 16(RSP)
    v21
    00025 (275) PCDATA $2, $1
    v21
    00026 (275) PCDATA $0, $0
    v21
    00027 (275) MOVD $""..autotmp_9-16(RSP), R0
    v25
    00028 (275) PCDATA $2, $0
    v25
    00029 (275) MOVD R0, 24(RSP)
    v18
    00030 (275) MOVD $1, R0
    v14
    00031 (275) MOVD R0, 32(RSP)
    v34
    00032 (275) MOVD R0, 40(RSP)
    v35
    00033 (275) CALL fmt.Fprintln(SB)
    b4
    00034 (?) RET
    00035 (?) END