Skip to content
Draft
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
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ jobs:
]
version:
- 'lts'
- '1.11'
- '1.12'
- 'pre'
arch:
- x64
include:
Expand Down Expand Up @@ -113,8 +113,8 @@ jobs:
]
version:
- 'lts'
- '1.11'
- '1.12'
- 'pre'
arch:
- x64
include:
Expand Down
12 changes: 9 additions & 3 deletions ext/MooncakeAllocCheckExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ module MooncakeAllocCheckExt
using AllocCheck, Mooncake
import Mooncake.TestUtils: check_allocs_internal, Shim

@check_allocs check_allocs_internal(::Shim, f::F, x) where {F} = f(x)
@check_allocs check_allocs_internal(::Shim, f::F, x, y) where {F} = f(x, y)
@check_allocs check_allocs_internal(::Shim, f::F, x, y, z) where {F} = f(x, y, z)
@static if VERSION < v"1.13-"
@check_allocs check_allocs_internal(::Shim, f::F, x) where {F} = f(x)
@check_allocs check_allocs_internal(::Shim, f::F, x, y) where {F} = f(x, y)
@check_allocs check_allocs_internal(::Shim, f::F, x, y, z) where {F} = f(x, y, z)
else
check_allocs_internal(::Shim, f::F, x) where {F} = f(x)
check_allocs_internal(::Shim, f::F, x, y) where {F} = f(x, y)
check_allocs_internal(::Shim, f::F, x, y, z) where {F} = f(x, y, z)
end

# TODO: remove the fix below after https://github.com/JuliaLang/AllocCheck.jl/pull/100 is merged
function __init__()
Expand Down
4 changes: 3 additions & 1 deletion src/Mooncake.jl
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ using .BasicBlockCode

include(joinpath("interpreter", "contexts.jl"))
include(joinpath("interpreter", "abstract_interpretation.jl"))
include(joinpath("interpreter", "patch_for_319.jl"))
@static if VERSION < v"1.13-"
include(joinpath("interpreter", "patch_for_319.jl"))
end
include(joinpath("interpreter", "ir_utils.jl"))
include(joinpath("interpreter", "ir_normalisation.jl"))
include(joinpath("interpreter", "zero_like_rdata.jl"))
Expand Down
18 changes: 11 additions & 7 deletions src/interpreter/ir_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,18 @@ function optimise_ir!(ir::IRCode; show_ir=false, do_inline=true, interp=nothing)
CC.verify_ir(ir)
ir = __strip_coverage!(ir)
ir = CC.compact!(ir)
if isnothing(interp)
# 319 -- see patch_for_319.jl for context
# replace by a simple NativeInterpreter() once fixed in Julia
local_interp = infer_interp = BugPatchInterpreter()
@static if VERSION ≥ v"1.13-"
local_interp = infer_interp = CC.NativeInterpreter()
else
local_interp = interp
# 319 -- even if interp was explicitly given, use a BugPatchInterpreter for inference
infer_interp = BugPatchInterpreter()
if isnothing(interp)
# 319 -- see patch_for_319.jl for context
# replace by a simple NativeInterpreter() once fixed in Julia
local_interp = infer_interp = BugPatchInterpreter()
else
local_interp = interp
# 319 -- even if interp was explicitly given, use a BugPatchInterpreter for inference
infer_interp = BugPatchInterpreter()
end
end
mi = __get_toplevel_mi_from_ir(ir, @__MODULE__)
ir = __infer_ir!(ir, infer_interp, mi)
Expand Down
Loading