You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia>const debug =falsefalse
julia>functionfoo()
if debug
println("Debugging...")
end1+2end
foo (generic function with 1 method)
julia>@code_llvmfoo()
define i64 @julia_foo17924() {
top:%0= alloca [4 x %jl_value_t*], align 8%.sub = getelementptr inbounds [4 x %jl_value_t*]*%0, i64 0, i64 0
store %jl_value_t* inttoptr (i64 4 to %jl_value_t*), %jl_value_t**%.sub, align 8%1= load %jl_value_t***@jl_pgcstack, align 8, !dbg !876
%2= getelementptr [4 x %jl_value_t*]*%0, i64 0, i64 1, !dbg !876
%.c = bitcast %jl_value_t**%1 to %jl_value_t*, !dbg !876
store %jl_value_t*%.c, %jl_value_t**%2, align 8, !dbg !876
store %jl_value_t**%.sub, %jl_value_t***@jl_pgcstack, align 8, !dbg !876
%3= getelementptr [4 x %jl_value_t*]*%0, i64 0, i64 2
store %jl_value_t* null, %jl_value_t**%3, align 8%4= getelementptr [4 x %jl_value_t*]*%0, i64 0, i64 3
store %jl_value_t* null, %jl_value_t**%4, align 8%5= load %jl_value_t**%2, align 8, !dbg !877
%6= getelementptr inbounds %jl_value_t*%5, i64 0, i32 0, !dbg !877
store %jl_value_t**%6, %jl_value_t***@jl_pgcstack, align 8, !dbg !877
ret i64 3, !dbg !877
}
It would be nice if the fact that the if debug branch can't possibly happen were detected early enough to avoid allocation of a GC frame, allowing the branch to get fully eliminated.
The text was updated successfully, but these errors were encountered:
Could constant values be propagated by extending the type-inference framework? Constant propagation and type inference in Julia are similar forward-flow problems.
Currently, we have this:
It would be nice if the fact that the
if debug
branch can't possibly happen were detected early enough to avoid allocation of a GC frame, allowing the branch to get fully eliminated.The text was updated successfully, but these errors were encountered: