Constant propagation depth

For this case const propgate was blocked by sqrt:

c() = sin(sin(sin(sin(1)))); @code_typed c()
CodeInfo(
1 ─ %1 = Base.Math.sqrt_llvm(2.220446049250313e-16)::Float64
│   %2 = Base.lt_float(0.7456241416655579, %1)::Bool
└──      goto #3 if not %2
2 ─      goto #4
3 ─      goto #4
4 ┄ %6 = φ (#2 => 0.7456241416655579, #3 => 0.6784304773607402)::Float64
│   %7 = invoke Main.sin(%6::Float64)::Float64
└──      return %7
) => Float64

And looks like we disable it for correctness, see (https://github.com/JuliaLang/julia/blob/3a3cf028eb5e3138b0dfe5e31efce7f87f5cbfe3/base/compiler/optimize.jl#L547-L556)

2 Likes