Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More nightly #2027

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/compiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,7 @@ function prepare_llvm(mod, job, meta)
end
llvmfn = functions(mod)[k_name]

RT = Core.Compiler.typeinf_ext_toplevel(interp, mi).rettype
RT = compute_rt(interp, mi)

_, _, returnRoots = get_return_info(RT)
returnRoots = returnRoots !== nothing
Expand Down Expand Up @@ -4566,7 +4566,7 @@ function create_abi_wrapper(
funcspec = my_methodinstance(Func, Tuple{}, world)
llvmf = nested_codegen!(Mode, mod, funcspec, world)
push!(function_attributes(llvmf), EnumAttribute("alwaysinline", 0))
Func_RT = Core.Compiler.typeinf_ext_toplevel(interp, funcspec).rettype
Func_RT = compute_rt(interp, funcspec)
@assert Func_RT == NTuple{width,T′}
_, psret, _ = get_return_info(Func_RT)
args = LLVM.Value[]
Expand Down Expand Up @@ -8349,7 +8349,7 @@ end
Core.Compiler.typeinf_type(interp, mi.def, mi.specTypes, mi.sparam_vals),
Any,
)
rrt = Core.Compiler.typeinf_ext_toplevel(interp, mi).rettype
rrt = compute_rt(interp, mi)

run_enzyme = true

Expand Down
10 changes: 10 additions & 0 deletions src/compiler/optimize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2524,7 +2524,9 @@ function optimize!(mod::LLVM.Module, tm)
add_transform_info!(pm, tm)

propagate_julia_addrsp_tm!(pm, tm)
@static if VERSION < v"1.12.0-DEV.1390"
scoped_no_alias_aa!(pm)
end
type_based_alias_analysis!(pm)
basic_alias_analysis!(pm)
cfgsimplification!(pm)
Expand All @@ -2544,7 +2546,9 @@ function optimize!(mod::LLVM.Module, tm)
add_library_info!(pm, triple(mod))
add_transform_info!(pm, tm)

@static if VERSION < v"1.12.0-DEV.1390"
scoped_no_alias_aa!(pm)
end
type_based_alias_analysis!(pm)
basic_alias_analysis!(pm)
cpu_features_tm!(pm, tm)
Expand All @@ -2558,7 +2562,9 @@ function optimize!(mod::LLVM.Module, tm)
add_library_info!(pm, triple(mod))
add_transform_info!(pm, tm)

@static if VERSION < v"1.12.0-DEV.1390"
scoped_no_alias_aa!(pm)
end
type_based_alias_analysis!(pm)
basic_alias_analysis!(pm)
cpu_features_tm!(pm, tm)
Expand Down Expand Up @@ -2633,7 +2639,9 @@ function optimize!(mod::LLVM.Module, tm)
add_library_info!(pm, triple(mod))
add_transform_info!(pm, tm)

@static if VERSION < v"1.12.0-DEV.1390"
scoped_no_alias_aa!(pm)
end
type_based_alias_analysis!(pm)
basic_alias_analysis!(pm)
cpu_features_tm!(pm, tm)
Expand All @@ -2660,7 +2668,9 @@ function addOptimizationPasses!(pm, tm)
constant_merge!(pm)

propagate_julia_addrsp_tm!(pm, tm)
@static if VERSION < v"1.12.0-DEV.1390"
scoped_no_alias_aa!(pm)
end
type_based_alias_analysis!(pm)
basic_alias_analysis!(pm)
cfgsimplification!(pm)
Expand Down
9 changes: 9 additions & 0 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -366,3 +366,12 @@ end

export sret_ty

@inline function compute_rt(interp::Core.Compiler.AbstractInterpreter, mi::MethodInstance)
@static if VERSION < v"1.11-"
return Core.Compiler.typeinf_ext_toplevel(interp, mi).rettype
else
return Core.Compiler.typeinf_type(interp, mi)
end
end

export compute_rt
Loading