Open topolarity opened 2 weeks ago
I followed the instructions at https://docs.julialang.org/en/v1.12-dev/devdocs/llvm/#Debugging-LLVM-transformations-in-isolation to do some Julia pass debugging.
optimize = false fun, T = iterate, Tuple{Base.ANSIIterator, Tuple{Int64, Tuple{Base.RegexMatch{String}, Tuple{Int64, Bool}}}} open("iterate.ll", "w") do file println(file, InteractiveUtils._dump_function(fun, T, false, false, false, true, :att, optimize, :default, false)) end
It looks like this is not a correct workflow, since it leads to invalid IR when trying to run opt:
opt
$ ./usr/tools/opt -load-pass-plugin=usr/lib/libjulia-codegen.so --passes='julia' -o iterate_opt.bc iterate.ll Invalid derived pointer in jlcall %35 = call nonnull ptr (ptr, ptr, ...) @julia.call(ptr @ijl_apply_generic, ptr %"+Core.BoundsError#596", ptr %"box::SubString193", ptr %box_Int64195) Invalid derived pointer in jlcall %35 = call nonnull ptr (ptr, ptr, ...) @julia.call(ptr @ijl_apply_generic, ptr %"+Core.BoundsError#596", ptr %"box::SubString193", ptr %box_Int64195) Invalid derived pointer in jlcall %184 = call nonnull ptr (ptr, ptr, ...) @julia.call(ptr @ijl_apply_generic, ptr %"+Core.ArgumentError#561", ptr %"jl_global#562") Invalid derived pointer in jlcall %265 = call nonnull ptr (ptr, ptr, ...) @julia.call(ptr @ijl_apply_generic, ptr %"+Core.ArgumentError#56125", ptr %"jl_global#568") Invalid derived pointer in jlcall %290 = call nonnull ptr (ptr, ptr, ...) @julia.call(ptr @ijl_apply_generic, ptr %"jl_global#571", ptr %"I::ANSIIterator.captures", ptr %"box::Tuple") Invalid derived pointer in jlcall %290 = call nonnull ptr (ptr, ptr, ...) @julia.call(ptr @ijl_apply_generic, ptr %"jl_global#571", ptr %"I::ANSIIterator.captures", ptr %"box::Tuple") Invalid derived pointer in jlcall %jl_f_tuple_ret = call nonnull ptr (ptr, ptr, ...) @julia.call(ptr @jl_f_tuple, ptr null, ptr %box_Int64, ptr %290) Invalid derived pointer in jlcall %jl_f_tuple_ret = call nonnull ptr (ptr, ptr, ...) @julia.call(ptr @jl_f_tuple, ptr null, ptr %box_Int64, ptr %290) Invalid derived pointer in jlcall %jl_f_tuple_ret46 = call nonnull ptr (ptr, ptr, ...) @julia.call(ptr @jl_f_tuple, ptr null, ptr %295, ptr %jl_f_tuple_ret) Invalid derived pointer in jlcall %jl_f_tuple_ret46 = call nonnull ptr (ptr, ptr, ...) @julia.call(ptr @jl_f_tuple, ptr null, ptr %295, ptr %jl_f_tuple_ret) PLEASE submit a bug report to https://github.com/julialang/julia and include the crash backtrace.
You need raw=true which I think thoose docs don't have.
Aha! Yes, that seems to do the trick.
I followed the instructions at https://docs.julialang.org/en/v1.12-dev/devdocs/llvm/#Debugging-LLVM-transformations-in-isolation to do some Julia pass debugging.
It looks like this is not a correct workflow, since it leads to invalid IR when trying to run
opt
: