main,1

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.

sources

 
 
 
/home/rileythomp/github/go/demo3.go

AST

buildssa-body
. DCL # demo3.go:16:7
. . NAME-main.i esc(no) Class:PAUTO Offset:0 OnStack Used int tc(1) # demo3.go:16:7
. AS Def tc(1) # demo3.go:16:9
. . NAME-main.i esc(no) Class:PAUTO Offset:0 OnStack Used int tc(1) # demo3.go:16:7
. . LITERAL-8 int tc(1) # demo3.go:16:12
. FOUR tc(1) # demo3.go:16:2
. FOUR-Cond
. . LE bool tc(1) # demo3.go:16:17
. . . NAME-main.i esc(no) Class:PAUTO Offset:0 OnStack Used int tc(1) # demo3.go:16:7
. . . LITERAL-20 int tc(1) # demo3.go:16:20
. FOUR-Post
. . BLOCK # demo3.go:16:25
. . BLOCK-List
. . . AS tc(1) # demo3.go:16:25
. . . . NAME-main.i esc(no) Class:PAUTO Offset:0 OnStack Used int tc(1) # demo3.go:16:7
. . . . ADD int tc(1) # demo3.go:16:25
. . . . . NAME-main.i esc(no) Class:PAUTO Offset:0 OnStack Used int tc(1) # demo3.go:16:7
. . . . . LITERAL-1 int tc(1) # demo3.go:16:25
. FOUR-Body
. . IF # demo3.go:17:3
. . IF-Cond
. . . NOT # demo3.go:17:3
. . . . EQ bool tc(1) # demo3.go:17:14
. . . . . MOD int tc(1) # demo3.go:17:11
. . . . . . NAME-main.i esc(no) Class:PAUTO Offset:0 OnStack Used int tc(1) # demo3.go:16:7
. . . . . . LITERAL-8 int tc(1) # demo3.go:17:12
. . . . . LITERAL-0 int tc(1) # demo3.go:17:17
. . IF-Body
. . . CALLFUNC Walked tc(1) # demo3.go:18:5
. . . CALLFUNC-Fun
. . . . NAME-main.g Class:PFUNC Offset:0 Used FUNC-func() tc(1) # demo3.go:11:6
. . . CONTINUE tc(1) # demo3.go:19:4
. . CALLFUNC Walked tc(1) # demo3.go:21:4
. . CALLFUNC-Fun
. . . NAME-main.f Class:PFUNC Offset:0 Used FUNC-func() tc(1) # demo3.go:7:6
 

before insert phis

  • b1:
    • v1 (?) = InitMem <mem>
    • v2 (?) = SP <uintptr>
    • v3 (?) = SB <uintptr>
    • v4 (?) = Const64 <int> [8] (i[int])
    • v6 (?) = Const64 <int> [20]
    • v10 (?) = Const64 <int> [0]
    • v19 (?) = Const64 <int> [1]
  • Plainb2 (16)
  • b2: ← b1 b4
    • v5 (16) = FwdRef <int> {{[] i}} (i[int])
    • v7 (16) = Leq64 <bool> v5 v6
  • If v7b3 b5 (likely) (16)
  • b3: ← b2
    • v8 (17) = FwdRef <int> {{[] i}} (i[int])
    • v9 (17) = Mod64 <int> [false] v8 v4
    • v11 (17) = Eq64 <bool> v9 v10
  • If v11b6 b7 (17)
  • b4: ← b7 b6
    • v18 (16) = FwdRef <int> {{[] i}} (i[int])
    • v20 (16) = Add64 <int> v18 v19 (i[int])
    • v21 (16) = Add64 <int> v20 v19 (i[int])
    • v22 (16) = Add64 <int> v21 v19 (i[int])
    • v23 (16) = Add64 <int> v22 v19 (i[int])
  • Plainb2 (16)
  • b5: ← b2
    • v24 (15) = FwdRef <mem> {{[] mem}}
    • v25 (15) = MakeResult <mem> v24
  • Ret v25 (16)
  • b6: ← b3
    • v15 (21) = FwdRef <mem> {{[] mem}}
    • v16 (21) = StaticLECall <mem> {AuxCall{main.f}} v15
    • v17 (21) = SelectN <mem> [0] v16
  • Plainb4 (21)
  • b7: ← b3
    • v12 (18) = FwdRef <mem> {{[] mem}}
    • v13 (18) = StaticLECall <mem> {AuxCall{main.g}} v12
    • v14 (18) = SelectN <mem> [0] v13
  • Plainb4 (+19)
  • name i[int]: v4 v5 v8 v18 v20 v21 v22 v23
  • start

    • b1:
      • v1 (?) = InitMem <mem>
      • v2 (?) = SP <uintptr>
      • v3 (?) = SB <uintptr>
      • v4 (?) = Const64 <int> [8] (i[int])
      • v6 (?) = Const64 <int> [20]
      • v10 (?) = Const64 <int> [0]
      • v19 (?) = Const64 <int> [1]
    • Plainb2 (16)
    • b2: ← b1 b4
      • v5 (16) = Phi <int> v4 v23 (i[int])
      • v26 (18) = Phi <mem> v1 v27
      • v7 (16) = Leq64 <bool> v5 v6
    • If v7b3 b5 (likely) (16)
    • b3: ← b2
      • v8 (17) = Copy <int> v5 (i[int])
      • v9 (17) = Mod64 <int> [false] v8 v4
      • v11 (17) = Eq64 <bool> v9 v10
    • If v11b6 b7 (17)
    • b4: ← b7 b6
      • v27 (18) = Phi <mem> v14 v17
      • v18 (16) = Copy <int> v8 (i[int])
      • v20 (16) = Add64 <int> v18 v19 (i[int])
      • v21 (16) = Add64 <int> v20 v19 (i[int])
      • v22 (16) = Add64 <int> v21 v19 (i[int])
      • v23 (16) = Add64 <int> v22 v19 (i[int])
    • Plainb2 (16)
    • b5: ← b2
      • v24 (15) = Copy <mem> v26
      • v25 (15) = MakeResult <mem> v24
    • Ret v25 (16)
    • b6: ← b3
      • v15 (21) = Copy <mem> v26
      • v16 (21) = StaticLECall <mem> {AuxCall{main.f}} v15
      • v17 (21) = SelectN <mem> [0] v16
    • Plainb4 (21)
    • b7: ← b3
      • v12 (18) = Copy <mem> v26
      • v13 (18) = StaticLECall <mem> {AuxCall{main.g}} v12
      • v14 (18) = SelectN <mem> [0] v13
    • Plainb4 (+19)
  • name i[int]: v4 v5 v8 v18 v20 v21 v22 v23
  • number lines [4100 ns]

    • b1:
      • v1 (?) = InitMem <mem>
      • v2 (?) = SP <uintptr>
      • v3 (?) = SB <uintptr>
      • v4 (?) = Const64 <int> [8] (i[int])
      • v6 (?) = Const64 <int> [20]
      • v10 (?) = Const64 <int> [0]
      • v19 (?) = Const64 <int> [1]
    • Plainb2 (+16)
    • b2: ← b1 b4
      • v5 (16) = Phi <int> v4 v23 (i[int])
      • v26 (18) = Phi <mem> v1 v27
      • v7 (+16) = Leq64 <bool> v5 v6
    • If v7b3 b5 (likely) (16)
    • b3: ← b2
      • v8 (17) = Copy <int> v5 (i[int])
      • v9 (+17) = Mod64 <int> [false] v8 v4
      • v11 (17) = Eq64 <bool> v9 v10
    • If v11b6 b7 (17)
    • b4: ← b7 b6
      • v27 (18) = Phi <mem> v14 v17
      • v18 (16) = Copy <int> v8 (i[int])
      • v20 (+16) = Add64 <int> v18 v19 (i[int])
      • v21 (16) = Add64 <int> v20 v19 (i[int])
      • v22 (16) = Add64 <int> v21 v19 (i[int])
      • v23 (16) = Add64 <int> v22 v19 (i[int])
    • Plainb2 (16)
    • b5: ← b2
      • v24 (15) = Copy <mem> v26
      • v25 (+15) = MakeResult <mem> v24
    • Ret v25 (+16)
    • b6: ← b3
      • v15 (21) = Copy <mem> v26
      • v16 (+21) = StaticLECall <mem> {AuxCall{main.f}} v15
      • v17 (21) = SelectN <mem> [0] v16
    • Plainb4 (21)
    • b7: ← b3
      • v12 (18) = Copy <mem> v26
      • v13 (+18) = StaticLECall <mem> {AuxCall{main.g}} v12
      • v14 (18) = SelectN <mem> [0] v13
    • Plainb4 (+19)
  • name i[int]: v4 v5 v8 v18 v20 v21 v22 v23
  • early phielim [1800 ns]

    • b1:
      • v1 (?) = InitMem <mem>
      • v2 (?) = SP <uintptr>
      • v3 (?) = SB <uintptr>
      • v4 (?) = Const64 <int> [8] (i[int])
      • v6 (?) = Const64 <int> [20]
      • v10 (?) = Const64 <int> [0]
      • v19 (?) = Const64 <int> [1]
    • Plainb2 (+16)
    • b2: ← b1 b4
      • v5 (16) = Phi <int> v4 v23 (i[int])
      • v26 (18) = Phi <mem> v1 v27
      • v7 (+16) = Leq64 <bool> v5 v6
    • If v7b3 b5 (likely) (16)
    • b3: ← b2
      • v8 (17) = Copy <int> v5 (i[int])
      • v9 (+17) = Mod64 <int> [false] v5 v4
      • v11 (17) = Eq64 <bool> v9 v10
    • If v11b6 b7 (17)
    • b4: ← b7 b6
      • v27 (18) = Phi <mem> v14 v17
      • v18 (16) = Copy <int> v5 (i[int])
      • v20 (+16) = Add64 <int> v5 v19 (i[int])
      • v21 (16) = Add64 <int> v20 v19 (i[int])
      • v22 (16) = Add64 <int> v21 v19 (i[int])
      • v23 (16) = Add64 <int> v22 v19 (i[int])
    • Plainb2 (16)
    • b5: ← b2
      • v24 (15) = Copy <mem> v26
      • v25 (+15) = MakeResult <mem> v26
    • Ret v25 (+16)
    • b6: ← b3
      • v15 (21) = Copy <mem> v26
      • v16 (+21) = StaticLECall <mem> {AuxCall{main.f}} v26
      • v17 (21) = SelectN <mem> [0] v16
    • Plainb4 (21)
    • b7: ← b3
      • v12 (18) = Copy <mem> v26
      • v13 (+18) = StaticLECall <mem> {AuxCall{main.g}} v26
      • v14 (18) = SelectN <mem> [0] v13
    • Plainb4 (+19)
  • name i[int]: v4 v5 v8 v18 v20 v21 v22 v23
  • early copyelim [1000 ns]

    • b1:
      • v1 (?) = InitMem <mem>
      • v2 (?) = SP <uintptr>
      • v3 (?) = SB <uintptr>
      • v4 (?) = Const64 <int> [8] (i[int])
      • v6 (?) = Const64 <int> [20]
      • v10 (?) = Const64 <int> [0]
      • v19 (?) = Const64 <int> [1]
    • Plainb2 (+16)
    • b2: ← b1 b4
      • v5 (16) = Phi <int> v4 v23 (i[int])
      • v26 (18) = Phi <mem> v1 v27
      • v7 (+16) = Leq64 <bool> v5 v6
    • If v7b3 b5 (likely) (16)
    • b3: ← b2
      • v8 (17) = Copy <int> v5
      • v9 (+17) = Mod64 <int> [false] v5 v4
      • v11 (17) = Eq64 <bool> v9 v10
    • If v11b6 b7 (17)
    • b4: ← b7 b6
      • v27 (18) = Phi <mem> v14 v17
      • v18 (16) = Copy <int> v5
      • v20 (+16) = Add64 <int> v5 v19 (i[int])
      • v21 (16) = Add64 <int> v20 v19 (i[int])
      • v22 (16) = Add64 <int> v21 v19 (i[int])
      • v23 (16) = Add64 <int> v22 v19 (i[int])
    • Plainb2 (16)
    • b5: ← b2
      • v24 (15) = Copy <mem> v26
      • v25 (+15) = MakeResult <mem> v26
    • Ret v25 (+16)
    • b6: ← b3
      • v15 (21) = Copy <mem> v26
      • v16 (+21) = StaticLECall <mem> {AuxCall{main.f}} v26
      • v17 (21) = SelectN <mem> [0] v16
    • Plainb4 (21)
    • b7: ← b3
      • v12 (18) = Copy <mem> v26
      • v13 (+18) = StaticLECall <mem> {AuxCall{main.g}} v26
      • v14 (18) = SelectN <mem> [0] v13
    • Plainb4 (+19)
  • name i[int]: v4 v5 v5 v5 v20 v21 v22 v23
  • early deadcode [5300 ns]

    • b1:
      • v1 (?) = InitMem <mem>
      • v4 (?) = Const64 <int> [8] (i[int])
      • v6 (?) = Const64 <int> [20]
      • v10 (?) = Const64 <int> [0]
      • v19 (?) = Const64 <int> [1]
    • Plainb2 (+16)
    • b2: ← b1 b4
      • v5 (16) = Phi <int> v4 v23 (i[int])
      • v26 (18) = Phi <mem> v1 v27
      • v7 (+16) = Leq64 <bool> v5 v6
    • If v7b3 b5 (likely) (16)
    • b3: ← b2
      • v9 (+17) = Mod64 <int> [false] v5 v4
      • v11 (17) = Eq64 <bool> v9 v10
    • If v11b6 b7 (17)
    • b4: ← b7 b6
      • v27 (18) = Phi <mem> v14 v17
      • v20 (+16) = Add64 <int> v5 v19 (i[int])
      • v21 (16) = Add64 <int> v20 v19 (i[int])
      • v22 (16) = Add64 <int> v21 v19 (i[int])
      • v23 (16) = Add64 <int> v22 v19 (i[int])
    • Plainb2 (16)
    • b5: ← b2
      • v25 (+15) = MakeResult <mem> v26
    • Ret v25 (+16)
    • b6: ← b3
      • v16 (+21) = StaticLECall <mem> {AuxCall{main.f}} v26
      • v17 (21) = SelectN <mem> [0] v16
    • Plainb4 (21)
    • b7: ← b3
      • v13 (+18) = StaticLECall <mem> {AuxCall{main.g}} v26
      • v14 (18) = SelectN <mem> [0] v13
    • Plainb4 (+19)
  • name i[int]: v4 v5 v20 v21 v22 v23
  • short circuit [1100 ns]

    decompose user [500 ns]

    pre-opt deadcode [2500 ns]

    opt [18900 ns]

    • b1:
      • v1 (?) = InitMem <mem>
      • v4 (?) = Const64 <int> [8] (i[int])
      • v6 (?) = Const64 <int> [20]
    • Plainb2 (+16)
    • b2: ← b1 b4
      • v5 (16) = Phi <int> v4 v23 (i[int])
      • v26 (18) = Phi <mem> v1 v27
      • v7 (+16) = Leq64 <bool> v5 v6
    • If v7b3 b5 (likely) (16)
    • b3: ← b2
      • v35 (17) = Const64 <int> [7]
      • v36 (17) = Const64 <int> [0]
      • v34 (+17) = And64 <int> v5 v35
      • v11 (+17) = Eq64 <bool> v34 v36
    • If v11b6 b7 (17)
    • b4: ← b7 b6
      • v27 (18) = Phi <mem> v14 v17
      • v3 (16) = Const64 <int> [4]
      • v23 (+16) = Add64 <int> v3 v5 (i[int])
    • Plainb2 (16)
    • b5: ← b2
      • v25 (+15) = MakeResult <mem> v26
    • Ret v25 (+16)
    • b6: ← b3
      • v16 (+21) = StaticLECall <mem> {AuxCall{main.f}} v26
      • v17 (21) = SelectN <mem> [0] v16
    • Plainb4 (21)
    • b7: ← b3
      • v13 (+18) = StaticLECall <mem> {AuxCall{main.g}} v26
      • v14 (18) = SelectN <mem> [0] v13
    • Plainb4 (+19)
  • name i[int]: v4 v5 v20 v21 v22 v23
  • zero arg cse [3300 ns]

    • b1:
      • v1 (?) = InitMem <mem>
      • v4 (?) = Const64 <int> [8] (i[int])
      • v6 (?) = Const64 <int> [20]
      • v35 (17) = Const64 <int> [7]
      • v36 (17) = Const64 <int> [0]
      • v3 (16) = Const64 <int> [4]
    • Plainb2 (+16)
    • b2: ← b1 b4
      • v5 (16) = Phi <int> v4 v23 (i[int])
      • v26 (18) = Phi <mem> v1 v27
      • v7 (+16) = Leq64 <bool> v5 v6
    • If v7b3 b5 (likely) (16)
    • b3: ← b2
      • v34 (+17) = And64 <int> v5 v35
      • v11 (+17) = Eq64 <bool> v34 v36
    • If v11b6 b7 (17)
    • b4: ← b7 b6
      • v27 (18) = Phi <mem> v14 v17
      • v23 (+16) = Add64 <int> v3 v5 (i[int])
    • Plainb2 (16)
    • b5: ← b2
      • v25 (+15) = MakeResult <mem> v26
    • Ret v25 (+16)
    • b6: ← b3
      • v16 (+21) = StaticLECall <mem> {AuxCall{main.f}} v26
      • v17 (21) = SelectN <mem> [0] v16
    • Plainb4 (21)
    • b7: ← b3
      • v13 (+18) = StaticLECall <mem> {AuxCall{main.g}} v26
      • v14 (18) = SelectN <mem> [0] v13
    • Plainb4 (+19)
  • name i[int]: v4 v5 v20 v21 v22 v23
  • opt deadcode [3900 ns]

    • b1:
      • v1 (?) = InitMem <mem>
      • v4 (?) = Const64 <int> [8] (i[int])
      • v6 (?) = Const64 <int> [20]
      • v35 (17) = Const64 <int> [7]
      • v36 (17) = Const64 <int> [0]
      • v3 (16) = Const64 <int> [4]
    • Plainb2 (+16)
    • b2: ← b1 b4
      • v5 (16) = Phi <int> v4 v23 (i[int])
      • v26 (18) = Phi <mem> v1 v27
      • v7 (+16) = Leq64 <bool> v5 v6
    • If v7b3 b5 (likely) (16)
    • b3: ← b2
      • v34 (+17) = And64 <int> v5 v35
      • v11 (+17) = Eq64 <bool> v34 v36
    • If v11b6 b7 (17)
    • b4: ← b7 b6
      • v27 (18) = Phi <mem> v14 v17
      • v23 (+16) = Add64 <int> v3 v5 (i[int])
    • Plainb2 (16)
    • b5: ← b2
      • v25 (+15) = MakeResult <mem> v26
    • Ret v25 (+16)
    • b6: ← b3
      • v16 (+21) = StaticLECall <mem> {AuxCall{main.f}} v26
      • v17 (21) = SelectN <mem> [0] v16
    • Plainb4 (21)
    • b7: ← b3
      • v13 (+18) = StaticLECall <mem> {AuxCall{main.g}} v26
      • v14 (18) = SelectN <mem> [0] v13
    • Plainb4 (+19)
  • name i[int]: v4 v5 v23
  • generic cse [7100 ns]

    phiopt [700 ns]

    gcse deadcode [2200 ns]

    nilcheckelim [4300 ns]

    prove [41200 ns]

    • b1:
      • v1 (?) = InitMem <mem>
      • v4 (?) = Const64 <int> [8] (i[int])
      • v6 (?) = Const64 <int> [20]
      • v35 (17) = Const64 <int> [7]
      • v36 (17) = Const64 <int> [0]
      • v3 (16) = Const64 <int> [4]
      • v8 (?) = Const64 <int64> [0]
    • Plainb2 (+16)
    • b2: ← b1 b4
      • v5 (16) = Phi <int> v4 v23 (i[int])
      • v26 (18) = Phi <mem> v1 v27
      • v7 (+16) = Leq64 <bool> v5 v6
    • If v7b3 b5 (likely) (16)
    • b3: ← b2
      • v34 (+17) = And64 <int> v5 v35
      • v11 (+17) = Eq64 <bool> v34 v36
    • If v11b6 b7 (17)
    • b4: ← b7 b6
      • v27 (18) = Phi <mem> v14 v17
      • v23 (+16) = Add64 <int> v3 v5 (i[int])
    • Plainb2 (16)
    • b5: ← b2
      • v25 (+15) = MakeResult <mem> v26
    • Ret v25 (+16)
    • b6: ← b3
      • v16 (+21) = StaticLECall <mem> {AuxCall{main.f}} v26
      • v17 (21) = SelectN <mem> [0] v16
    • Plainb4 (21)
    • b7: ← b3
      • v13 (+18) = StaticLECall <mem> {AuxCall{main.g}} v26
      • v14 (18) = SelectN <mem> [0] v13
    • Plainb4 (+19)
  • name i[int]: v4 v5 v23
  • early fuse [500 ns]

    expand calls [3600 ns]

    • b1:
      • v1 (?) = InitMem <mem>
      • v4 (?) = Const64 <int> [8] (i[int])
      • v6 (?) = Const64 <int> [20]
      • v35 (17) = Const64 <int> [7]
      • v36 (17) = Const64 <int> [0]
      • v3 (16) = Const64 <int> [4]
      • v8 (?) = Const64 <int64> [0]
      • v18 (?) = SB <uintptr>
      • v22 (?) = SP <uintptr>
    • Plainb2 (+16)
    • b2: ← b1 b4
      • v5 (16) = Phi <int> v4 v23 (i[int])
      • v26 (18) = Phi <mem> v1 v27
      • v7 (+16) = Leq64 <bool> v5 v6
    • If v7b3 b5 (likely) (16)
    • b3: ← b2
      • v34 (+17) = And64 <int> v5 v35
      • v11 (+17) = Eq64 <bool> v34 v36
    • If v11b6 b7 (17)
    • b4: ← b7 b6
      • v27 (18) = Phi <mem> v14 v17
      • v23 (+16) = Add64 <int> v3 v5 (i[int])
    • Plainb2 (16)
    • b5: ← b2
      • v25 (+15) = MakeResult <mem> v26
    • Ret v25 (+16)
    • b6: ← b3
      • v16 (+21) = StaticCall <mem> {AuxCall{main.f}} v26
      • v17 (21) = SelectN <mem> [0] v16
    • Plainb4 (21)
    • b7: ← b3
      • v13 (+18) = StaticCall <mem> {AuxCall{main.g}} v26
      • v14 (18) = SelectN <mem> [0] v13
    • Plainb4 (+19)
  • name i[int]: v4 v5 v23
  • decompose builtin [5400 ns]

    softfloat [100 ns]

    late opt [5600 ns]

    • b1:
      • v1 (?) = InitMem <mem>
      • v4 (?) = Const64 <int> [8] (i[int])
      • v6 (?) = Const64 <int> [20]
      • v35 (17) = Const64 <int> [7]
      • v36 (17) = Const64 <int> [0]
      • v3 (16) = Const64 <int> [4]
    • Plainb2 (+16)
    • b2: ← b1 b4
      • v5 (16) = Phi <int> v4 v23 (i[int])
      • v26 (18) = Phi <mem> v1 v27
      • v7 (+16) = Leq64 <bool> v5 v6
    • If v7b3 b5 (likely) (16)
    • b3: ← b2
      • v34 (+17) = And64 <int> v5 v35
      • v11 (+17) = Eq64 <bool> v34 v36
    • If v11b6 b7 (17)
    • b4: ← b7 b6
      • v27 (18) = Phi <mem> v14 v17
      • v23 (+16) = Add64 <int> v3 v5 (i[int])
    • Plainb2 (16)
    • b5: ← b2
      • v25 (+15) = MakeResult <mem> v26
    • Ret v25 (+16)
    • b6: ← b3
      • v16 (+21) = StaticCall <mem> {AuxCall{main.f}} v26
      • v17 (21) = SelectN <mem> [0] v16
    • Plainb4 (21)
    • b7: ← b3
      • v13 (+18) = StaticCall <mem> {AuxCall{main.g}} v26
      • v14 (18) = SelectN <mem> [0] v13
    • Plainb4 (+19)
  • name i[int]: v4 v5 v23
  • dead auto elim [1900 ns]

    sccp [18100 ns]

    • b1:
      • v1 (?) = InitMem <mem>
      • v4 (?) = Const64 <int> [8] (i[int])
      • v6 (?) = Const64 <int> [20]
      • v35 (17) = Const64 <int> [7]
      • v36 (17) = Const64 <int> [0]
      • v3 (16) = Const64 <int> [4]
      • v22 (+16) = ConstBool <bool> [true]
      • v18 (+17) = Const64 <int> [0]
      • v8 (+16) = ConstBool <bool> [true]
      • v21 (+17) = Const64 <int> [0]
      • v20 (+17) = ConstBool <bool> [true]
      • v33 (+16) = Const64 <int> [12]
    • Plainb2 (+16)
    • b2: ← b1 b4
      • v5 (16) = Phi <int> v4 v23 (i[int])
      • v26 (18) = Phi <mem> v1 v27
      • v7 (+16) = Leq64 <bool> v5 v6
    • If v7b3 b5 (likely) (16)
    • b3: ← b2
      • v34 (+17) = And64 <int> v5 v35
      • v11 (+17) = Eq64 <bool> v34 v36
    • If v11b6 b7 (17)
    • b4: ← b7 b6
      • v27 (18) = Phi <mem> v14 v17
      • v23 (+16) = Add64 <int> v3 v5 (i[int])
    • Plainb2 (16)
    • b5: ← b2
      • v25 (+15) = MakeResult <mem> v26
    • Ret v25 (+16)
    • b6: ← b3
      • v16 (+21) = StaticCall <mem> {AuxCall{main.f}} v26
      • v17 (21) = SelectN <mem> [0] v16
    • Plainb4 (21)
    • b7: ← b3
      • v13 (+18) = StaticCall <mem> {AuxCall{main.g}} v26
      • v14 (18) = SelectN <mem> [0] v13
    • Plainb4 (+19)
  • name i[int]: v4 v5 v23
  • generic deadcode [4500 ns]

    • b1:
      • v1 (?) = InitMem <mem>
      • v4 (?) = Const64 <int> [8] (i[int])
      • v6 (?) = Const64 <int> [20]
      • v35 (+17) = Const64 <int> [7]
      • v36 (17) = Const64 <int> [0]
      • v3 (+16) = Const64 <int> [4]
    • Plainb2 (+16)
    • b2: ← b1 b4
      • v5 (16) = Phi <int> v4 v23 (i[int])
      • v26 (18) = Phi <mem> v1 v27
      • v7 (+16) = Leq64 <bool> v5 v6
    • If v7b3 b5 (likely) (16)
    • b3: ← b2
      • v34 (+17) = And64 <int> v5 v35
      • v11 (+17) = Eq64 <bool> v34 v36
    • If v11b6 b7 (17)
    • b4: ← b7 b6
      • v27 (18) = Phi <mem> v14 v17
      • v23 (+16) = Add64 <int> v3 v5 (i[int])
    • Plainb2 (16)
    • b5: ← b2
      • v25 (+15) = MakeResult <mem> v26
    • Ret v25 (+16)
    • b6: ← b3
      • v16 (+21) = StaticCall <mem> {AuxCall{main.f}} v26
      • v17 (21) = SelectN <mem> [0] v16
    • Plainb4 (21)
    • b7: ← b3
      • v13 (+18) = StaticCall <mem> {AuxCall{main.g}} v26
      • v14 (18) = SelectN <mem> [0] v13
    • Plainb4 (+19)
  • name i[int]: v4 v5 v23
  • check bce [300 ns]

    branchelim [1000 ns]

    late fuse [1900 ns]

    • b1:
      • v1 (?) = InitMem <mem>
      • v4 (?) = Const64 <int> [8] (i[int])
      • v6 (?) = Const64 <int> [20]
      • v35 (+17) = Const64 <int> [7]
      • v36 (17) = Const64 <int> [0]
      • v3 (+16) = Const64 <int> [4]
      • v33 (?) = Const64 <int64> [0]
    • Plainb2 (+16)
    • b2: ← b1 b4
      • v5 (16) = Phi <int> v4 v23 (i[int])
      • v26 (18) = Phi <mem> v1 v27
      • v7 (+16) = Leq64 <bool> v5 v6
    • If v7b3 b5 (likely) (16)
    • b3: ← b2
      • v34 (+17) = And64 <int> v5 v35
      • v11 (+17) = Eq64 <bool> v34 v36
    • If v11b6 b7 (17)
    • b4: ← b7 b6
      • v27 (18) = Phi <mem> v14 v17
      • v23 (+16) = Add64 <int> v3 v5 (i[int])
    • Plainb2 (16)
    • b5: ← b2
      • v25 (+15) = MakeResult <mem> v26
    • Ret v25 (+16)
    • b6: ← b3
      • v16 (+21) = StaticCall <mem> {AuxCall{main.f}} v26
      • v17 (21) = SelectN <mem> [0] v16
    • Plainb4 (21)
    • b7: ← b3
      • v13 (+18) = StaticCall <mem> {AuxCall{main.g}} v26
      • v14 (18) = SelectN <mem> [0] v13
    • Plainb4 (+19)
  • name i[int]: v4 v5 v23
  • dse [3200 ns]

    memcombine [1100 ns]

    writebarrier [1800 ns]

    lower [18900 ns]

    • b1:
      • v1 (?) = InitMem <mem>
      • v4 (?) = MOVQconst <int> [8] (i[int])
    • Plainb2 (+16)
    • b2: ← b1 b4
      • v5 (16) = Phi <int> v4 v23 (i[int])
      • v26 (18) = Phi <mem> v1 v27
      • v21 (+16) = CMPQconst <flags> [20] v5
    • LE v21b3 b5 (likely) (16)
    • b3: ← b2
      • v18 (+17) = TESTQconst <flags> [7] v5
    • EQ v18b6 b7 (17)
    • b4: ← b7 b6
      • v27 (18) = Phi <mem> v14 v17
      • v23 (+16) = ADDQconst <int> [4] v5 (i[int])
    • Plainb2 (16)
    • b5: ← b2
      • v25 (+15) = MakeResult <mem> v26
    • Ret v25 (+16)
    • b6: ← b3
      • v16 (+21) = CALLstatic <mem> {AuxCall{main.f}} v26
      • v17 (21) = SelectN <mem> [0] v16
    • Plainb4 (21)
    • b7: ← b3
      • v13 (+18) = CALLstatic <mem> {AuxCall{main.g}} v26
      • v14 (18) = SelectN <mem> [0] v13
    • Plainb4 (+19)
  • name i[int]: v4 v5 v23
  • addressing modes [1200 ns]

    late lower [1400 ns]

    lowered deadcode for cse [2100 ns]

    lowered cse [2100 ns]

    elim unread autos [300 ns]

    tighten tuple selectors [1100 ns]

    lowered deadcode [1600 ns]

    checkLower [300 ns]

    late phielim [400 ns]

    late copyelim [500 ns]

    tighten [7900 ns]

    late deadcode [1300 ns]

    critical [900 ns]

    phi tighten [300 ns]

    likelyadjust [900 ns]

    layout [2800 ns]

    • b1:
      • v1 (?) = InitMem <mem>
      • v4 (?) = MOVQconst <int> [8] (i[int])
    • Plainb2 (+16)
    • b2: ← b1 b4
      • v5 (16) = Phi <int> v4 v23 (i[int])
      • v26 (18) = Phi <mem> v1 v27
      • v21 (+16) = CMPQconst <flags> [20] v5
    • LE v21b3 b5 (likely) (16)
    • b3: ← b2
      • v18 (+17) = TESTQconst <flags> [7] v5
    • EQ v18b6 b7 (17)
    • b6: ← b3
      • v16 (+21) = CALLstatic <mem> {AuxCall{main.f}} v26
      • v17 (21) = SelectN <mem> [0] v16
    • Plainb4 (21)
    • b7: ← b3
      • v13 (+18) = CALLstatic <mem> {AuxCall{main.g}} v26
      • v14 (18) = SelectN <mem> [0] v13
    • Plainb4 (+19)
    • b4: ← b7 b6
      • v27 (18) = Phi <mem> v14 v17
      • v23 (+16) = ADDQconst <int> [4] v5 (i[int])
    • Plainb2 (16)
    • b5: ← b2
      • v25 (+15) = MakeResult <mem> v26
    • Ret v25 (+16)
  • name i[int]: v4 v5 v23
  • schedule [6600 ns]

    late nilcheck [1700 ns]

    flagalloc [3100 ns]

    regalloc [37500 ns]

    • b1:
      • v1 (?) = InitMem <mem>
      • v11 (?) = MOVQconst <int> [8] : AX
    • Plainb2 (+16)
    • b2: ← b1 b4
      • v5 (16) = Phi <int> v11 v23 : AX (i[int])
      • v26 (18) = Phi <mem> v1 v27
      • v21 (+16) = CMPQconst <flags> [20] v5
    • LE v21b3 b5 (likely) (16)
    • b3: ← b2
      • v8 (16) = StoreReg <int> v5 : i[int]
      • v18 (+17) = TESTQconst <flags> [7] v5
    • EQ v18b6 b7 (17)
    • b6: ← b3
      • v16 (+21) = CALLstatic <mem> {AuxCall{main.f}} v26
      • v17 (21) = SelectN <mem> [0] v16
    • Plainb4 (21)
    • b7: ← b3
      • v13 (+18) = CALLstatic <mem> {AuxCall{main.g}} v26
      • v14 (18) = SelectN <mem> [0] v13
    • Plainb4 (+19)
    • b4: ← b7 b6
      • v27 (18) = Phi <mem> v14 v17
      • v34 (16) = LoadReg <int> v8 : AX
      • v23 (+16) = ADDQconst <int> [4] v34 : AX (i[int])
    • Plainb2 (16)
    • b5: ← b2
      • v25 (+15) = MakeResult <mem> v26
    • Ret v25 (+16)
  • name i[int]: v4 v5 v23
  • loop rotate [2200 ns]

    • b1:
      • v1 (?) = InitMem <mem>
      • v11 (?) = MOVQconst <int> [8] : AX
    • Plainb2 (+16)
    • b4: ← b7 b6
      • v27 (18) = Phi <mem> v14 v17
      • v34 (16) = LoadReg <int> v8 : AX
      • v23 (+16) = ADDQconst <int> [4] v34 : AX (i[int])
    • Plainb2 (16)
    • b2: ← b1 b4
      • v5 (16) = Phi <int> v11 v23 : AX (i[int])
      • v26 (18) = Phi <mem> v1 v27
      • v21 (+16) = CMPQconst <flags> [20] v5
    • LE v21b3 b5 (likely) (16)
    • b3: ← b2
      • v8 (16) = StoreReg <int> v5 : i[int]
      • v18 (+17) = TESTQconst <flags> [7] v5
    • EQ v18b6 b7 (17)
    • b6: ← b3
      • v16 (+21) = CALLstatic <mem> {AuxCall{main.f}} v26
      • v17 (21) = SelectN <mem> [0] v16
    • Plainb4 (21)
    • b7: ← b3
      • v13 (+18) = CALLstatic <mem> {AuxCall{main.g}} v26
      • v14 (18) = SelectN <mem> [0] v13
    • Plainb4 (+19)
    • b5: ← b2
      • v25 (+15) = MakeResult <mem> v26
    • Ret v25 (+16)
  • name i[int]: v4 v5 v23
  • trim [400 ns]

    • b1:
      • v1 (?) = InitMem <mem>
      • v11 (?) = MOVQconst <int> [8] : AX
    • Plainb2 (+16)
    • b4: ← b7 b6
      • v27 (18) = Phi <mem> v14 v17
      • v34 (16) = LoadReg <int> v8 : AX
      • v23 (+16) = ADDQconst <int> [4] v34 : AX (i[int])
    • Plainb2 (16)
    • b2: ← b1 b4
      • v5 (16) = Phi <int> v11 v23 : AX (i[int])
      • v26 (18) = Phi <mem> v1 v27
      • v21 (+16) = CMPQconst <flags> [20] v5
    • LE v21b3 b5 (likely) (16)
    • b3: ← b2
      • v8 (16) = StoreReg <int> v5 : i[int]
      • v18 (+17) = TESTQconst <flags> [7] v5
    • EQ v18b6 b7 (17)
    • b6: ← b3
      • v16 (+21) = CALLstatic <mem> {AuxCall{main.f}} v26
      • v17 (21) = SelectN <mem> [0] v16
    • Plainb4 (21)
    • b7: ← b3
      • v13 (+18) = CALLstatic <mem> {AuxCall{main.g}} v26
      • v14 (18) = SelectN <mem> [0] v13
    • Plainb4 (+19)
    • b5: ← b2
      • v25 (+15) = MakeResult <mem> v26
    • Ret v25 (+16)
  • name i[int]: v4 v5 v23
  • genssa

    # /home/rileythomp/github/go/demo3.go
    00000 (15) TEXT main.main(SB), ABIInternal
    00001 (15) FUNCDATA $0, gclocals·g2BeySu+wFnoycgXfElmcg==(SB)
    00002 (15) FUNCDATA $1, gclocals·g2BeySu+wFnoycgXfElmcg==(SB)
    v11
    00003 (15) MOVL $8, AX
    b1
    00004 (16) JMP 7
    v34
    00005 (+16) MOVQ main.i-8(SP), AX
    v23
    00006 (16) ADDQ $4, AX
    v21
    00007 (+16) CMPQ AX, $20
    b2
    00008 (16) JGT 17
    v8
    00009 (16) MOVQ AX, main.i-8(SP)
    v18
    00010 (+17) TESTQ $7, AX
    b3
    00011 (17) JNE 15
    v16
    00012 (+21) PCDATA $1, $0
    v16
    00013 (+21) CALL main.f(SB)
    b6
    00014 (21) JMP 5
    v13
    00015 (+18) CALL main.g(SB)
    b7
    00016 (+19) JMP 5
    b5
    00017 (+16) RET
    00018 (?) END