# How to read φ and π in @code\_typed output?

**URL:** https://discourse.julialang.org/t/how-to-read-and-in-code-typed-output/48623
**Category:** General Usage
**Created:** [October 19, 2020, 11:34am UTC](https://discourse.julialang.org/t/how-to-read-and-in-code-typed-output/48623 "2020-10-19T11:34:51Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![igloo](https://avatars.discourse-cdn.com/v4/letter/i/d6d6ee/32.png) [@igloo](https://discourse.julialang.org/u/igloo)
#### Post date: [October 19, 2020, 11:34am UTC](https://discourse.julialang.org/t/how-to-read-and-in-code-typed-output/48623/1 "2020-10-19T11:34:51Z")

</div>

Take for example the following snippet.

```julia
5 ── goto #6
6 ── %26 = Base.sub_float(%23, 1.0)::Float64
└─── goto #7
7 ── goto #8
8 ── goto #9
9 ── %30 = Base.lt_float(0.5, %26)::Bool
└─── goto #11 if not %30
10 ─ goto #12
11 ─ nothing::Nothing
12 ┄ %34 = φ (#10 => 2, #11 => _2)::Union{Float64, Int64}
│ %35 = (isa)(%34, Float64)::Bool
└─── goto #14 if not %35
13 ─ %37 = π (%34, Float64)
│ %38 = Base.div_float(4.0, %37)::Float64
└─── goto #17
14 ─ %40 = (isa)(%34, Int64)::Bool
└─── goto #16 if not %40
15 ─ %42 = π (%34, Int64)
│ %43 = Base.mul_int(3, %42)::Int64
└─── goto #17
16 ─ Core.throw(ErrorException("fatal error in type inference (type bound)"))::Union{}
└─── $(Expr(:unreachable))::Union{}
17 ┄ %47 = φ (#13 => %38, #15 => %43)::Union{Float64, Int64}
└─── return %47

```

How to read the first lines of branches 12, 13, 15, and 17?

---

<div class="post-metadata">

### Author: ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)
#### Post date: [October 19, 2020, 12:25pm UTC](https://discourse.julialang.org/t/how-to-read-and-in-code-typed-output/48623/2 "2020-10-19T12:25:15Z")

</div>

This is a good explanation of phi nodes: [Comp.compilers: Re: Phi nodes?](https://compilers.iecc.com/comparch/article/01-05-083)

---

<div class="post-metadata">

### Author: ![igloo](https://avatars.discourse-cdn.com/v4/letter/i/d6d6ee/32.png) [@igloo](https://discourse.julialang.org/u/igloo)
#### Post date: [October 19, 2020, 1:09pm UTC](https://discourse.julialang.org/t/how-to-read-and-in-code-typed-output/48623/3 "2020-10-19T13:09:23Z")

</div>

Thank you! That explains the φ nodes. Using this information I found more info on the π nodes here: [Julia SSA-form IR · The Julia Language](https://docs.julialang.org/en/v1/devdocs/ssair/#New-IR-nodes)
