Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

Commit

Permalink
More detailed irgen timings.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Mar 22, 2019
1 parent 2f7cc21 commit 37d55f6
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/compiler/irgen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,18 @@ function compile_linfo(job::CompilerJob, linfo::Core.MethodInstance, world)
end

function irgen(job::CompilerJob, linfo::Core.MethodInstance, world)
entry, modules = compile_linfo(job, linfo, world)
entry, modules = @timeit to[] "emission" compile_linfo(job, linfo, world)

# link in dependent modules
mod = popfirst!(modules)
for dep in modules
link!(mod, dep)
@timeit to[] "linking" begin
mod = popfirst!(modules)
for dep in modules
link!(mod, dep)
end
end

# clean up incompatibilities
for llvmf in functions(mod)
@timeit to[] "clean-up" for llvmf in functions(mod)
llvmfn = LLVM.name(llvmf)

# only occurs in debug builds
Expand Down Expand Up @@ -164,15 +166,14 @@ function irgen(job::CompilerJob, linfo::Core.MethodInstance, world)
LLVM.name!(entry, llvmfn)

# minimal required optimization
ModulePassManager() do pm
@timeit to[] "rewrite" ModulePassManager() do pm
global current_job
current_job = job

add!(pm, ModulePass("LowerThrow", lower_throw!))
add!(pm, FunctionPass("HideUnreachable", hide_unreachable!))
add!(pm, ModulePass("HideTrap", hide_trap!))
always_inliner!(pm)
verifier!(pm)
run!(pm, mod)
end

Expand Down

0 comments on commit 37d55f6

Please sign in to comment.