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

Add some timer outputs. #365

Merged
merged 4 commits into from
Mar 22, 2019
Merged
Changes from 1 commit
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
Prev Previous commit
More detailed irgen timings.
  • Loading branch information
maleadt committed Mar 22, 2019
commit dddecc73fac0644772205c5cbc7df15a6d83a503
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