diff --git a/src/MCAnalyzer.jl b/src/MCAnalyzer.jl index 9cc0dbf..f081d0f 100644 --- a/src/MCAnalyzer.jl +++ b/src/MCAnalyzer.jl @@ -31,10 +31,11 @@ function mcjob(@nospecialize(func), @nospecialize(types); cpu::String = (LLVM.version() < v"8") ? "" : unsafe_string(LLVM.API.LLVMGetHostCPUName()), features::String=(LLVM.version() < v"8") ? "" : unsafe_string(LLVM.API.LLVMGetHostCPUFeatures()), kwargs...) - source = FunctionSpec(func, Base.to_tuple_type(types), #=kernel=# false) + source = methodinstance(typeof(func), Base.to_tuple_type(types)) target = NativeCompilerTarget(cpu=cpu, features=features) params = CompilerParams() - CompilerJob(target, source, params), kwargs + config = CompilerConfig(target, params; kernel=false) + CompilerJob(source, config), kwargs end include("reflection.jl") @@ -78,8 +79,7 @@ analyze(mysum, (Vector{Float64},)) """ function analyze(@nospecialize(func), @nospecialize(tt), march=:SKL; kwargs...) job, kwargs = mcjob(func, tt; cpu=llvm_march(march), kwargs...) - mi, _ = GPUCompiler.emit_julia(job) - ir, func = GPUCompiler.emit_llvm(job, mi; ctx=JuliaContext(), only_entry=false, kwargs...) + ir, func = GPUCompiler.compile(:llvm, job; ctx=JuliaContext(), only_entry=false, kwargs...) mktempdir() do dir asmfile = joinpath(dir, "a.S") @@ -123,8 +123,7 @@ timeline(mysum, (Vector{Float64},)) """ function timeline(@nospecialize(func), @nospecialize(tt), march=:SKL; kwargs...) job, kwargs = mcjob(func, tt; cpu=llvm_march(march), kwargs...) - mi, _ = GPUCompiler.emit_julia(job) - ir, func = GPUCompiler.emit_llvm(job, mi; ctx=JuliaContext(), only_entry=false, kwargs...) + ir, _ = GPUCompiler.compile(:llvm, job; ctx=JuliaContext(), only_entry=false, kwargs...) mktempdir() do dir asmfile = joinpath(dir, "a.S") @@ -168,8 +167,7 @@ bottleneck(mysum, (Vector{Float64},)) """ function bottleneck(@nospecialize(func), @nospecialize(tt), march=:SKL; kwargs...) job, kwargs = mcjob(func, tt; cpu=llvm_march(march), kwargs...) - mi, _ = GPUCompiler.emit_julia(job) - ir, func = GPUCompiler.emit_llvm(job, mi; ctx=JuliaContext(), only_entry=false, kwargs...) + ir, _ = GPUCompiler.compile(:llvm, job; ctx=JuliaContext(), only_entry=false, kwargs...) mktempdir() do dir asmfile = joinpath(dir, "a.S") @@ -187,8 +185,7 @@ end function allstats(@nospecialize(func), @nospecialize(tt), march=:SKL; kwargs...) job, kwargs = mcjob(func, tt; cpu=llvm_march(march), kwargs...) - mi, _ = GPUCompiler.emit_julia(job) - ir, func = GPUCompiler.emit_llvm(job, mi; ctx=JuliaContext(), only_entry=false, kwargs...) + ir, func = GPUCompiler.compile(:llvm, job; ctx=JuliaContext(), only_entry=false, kwargs...) mktempdir() do dir asmfile = joinpath(dir, "a.S")