Created
June 4, 2019 03:30
-
-
Save bicycle1885/6f6725059614310b4f83df9fa3b56548 to your computer and use it in GitHub Desktop.
Constant folding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const a = (1, 2, 3, 4) | |
function func(b) | |
sum = 0 | |
for i in 1:4 | |
sum += a[i] * b[i] | |
end | |
return sum | |
end | |
function main() | |
b = (5, 6, 7, 8) | |
println(func(b)) | |
end | |
# julia> @code_llvm debuginfo=:none main() | |
# | |
# define nonnull %jl_value_t addrspace(10)* @japi1_main_12289(%jl_value_t addrspace(10)*, %jl_value_t addrspace(10)**, i32) #0 { | |
# L23: | |
# %3 = alloca %jl_value_t addrspace(10)**, align 8 | |
# store volatile %jl_value_t addrspace(10)** %1, %jl_value_t addrspace(10)*** %3, align 8 | |
# call void @julia_println_12216(i64 70) | |
# ret %jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 4423548936 to %jl_value_t*) to %jl_value_t addrspace(10)*) | |
# } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment