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

remove no-longer needed self profiling switches #63

Merged
merged 1 commit into from
Oct 30, 2020
Merged
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
30 changes: 0 additions & 30 deletions src/JET.jl
Original file line number Diff line number Diff line change
Expand Up @@ -282,36 +282,6 @@ end
# miscellaneous, interactive
# ----------------------------

const __self_profiling__ = Ref(false)

switch_self_profiling(enable = true) = __self_profiling__[] = enable

# when self-profiling, we need to invalidate caches for "our" code
@inline function force_invalidate_self_code_cache(mi::MethodInstance)
if __self_profiling__[]
def = mi.def
if isa(def, Method)
mod = def.module

# ignore cache for code defined in JET
mod == (@__MODULE__) && return true

# caches for overloaded code also need to be invalidated
mod == JuliaInterpreter && return true

# ignoring entire cache for `Core.Compiler` slows down performance too bad, so
# let's do more fine-grained, per-file basis check
# XXX: needs more files to be added ?
file = def.file
file === Symbol("compiler/cicache.jl") && return true
file === Symbol("compiler/abstractinterpretation.jl") && return true
file === Symbol("compiler/typeinfer.jl") && return true
end
end

return false
end

# profile from call expression
macro profile_call(ex, kwargs...)
@assert isexpr(ex, :call) "function call expression should be given"
Expand Down