Skip to content

More nightly #2027

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

Open
wants to merge 6 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
8 changes: 7 additions & 1 deletion src/compiler/interpreter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,9 @@ Core.Compiler.may_compress(@nospecialize(::EnzymeInterpreter)) = true
# but as far as I understand Enzyme wants "always inlining, except special cased functions",
# so I guess we really don't want to discard sources?
Core.Compiler.may_discard_trees(@nospecialize(::EnzymeInterpreter)) = false
@static if VERSION <= v"1.12-"
Core.Compiler.verbose_stmt_info(@nospecialize(::EnzymeInterpreter)) = false
end

Core.Compiler.method_table(@nospecialize(interp::EnzymeInterpreter)) = interp.method_table

Expand Down Expand Up @@ -355,7 +357,11 @@ function Core.Compiler.abstract_call_gf_by_type(
sv::AbsIntState,
max_methods::Int,
)
callinfo = ret.info
@static if VERSION <= v"1.11-"
callinfo = ret.info
else
callinfo = ret[].info
end
specTypes = simplify_kw(atype)

if is_primitive_func(specTypes)
Expand Down
10 changes: 10 additions & 0 deletions src/compiler/optimize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,9 @@ function optimize!(mod::LLVM.Module, tm::LLVM.TargetMachine)
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 @@ -479,7 +481,9 @@ function optimize!(mod::LLVM.Module, tm::LLVM.TargetMachine)
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 @@ -493,7 +497,9 @@ function optimize!(mod::LLVM.Module, tm::LLVM.TargetMachine)
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 @@ -568,7 +574,9 @@ function optimize!(mod::LLVM.Module, tm::LLVM.TargetMachine)
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 @@ -595,7 +603,9 @@ function addOptimizationPasses!(pm::LLVM.ModulePassManager, tm::LLVM.TargetMachi
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 @@ -423,3 +423,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