Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
5dfd3a6
Initial plan
Copilot Aug 27, 2025
ade6e08
Add Julia v1.12 compatibility for BBCode and IR infrastructure
Copilot Aug 27, 2025
ed221c7
Add 'pre' version to CI workflow
yebai Aug 27, 2025
1507b4d
Fix inlining_policy function name for Julia v1.12+ compatibility and …
Copilot Aug 27, 2025
b4fb31c
CompatHelper: bump compat for JET in [weakdeps] to 0.10, (keep existi…
github-actions[bot] Aug 28, 2025
1eb8a0e
Merge branch 'main' into copilot/fix-521d0edf-b6f3-4f8f-810a-9b67505e…
yebai Aug 28, 2025
6534540
Prevent exporting names already declared as public
serenity4 Aug 28, 2025
ab4d1d5
Extend required interface CC.add_edges_impl!
serenity4 Aug 28, 2025
4671737
Adapt to stackless inference change (using CC.Future etc)
serenity4 Aug 28, 2025
8e8484d
Always return a boolean from `src_inlining_policy`
serenity4 Aug 28, 2025
37abc8b
Fix relocation of a few Experimental functions to CC
serenity4 Aug 28, 2025
5204f39
Fix `_ir_abstract_constant_propagation` rename
serenity4 Aug 28, 2025
e18ed11
Adjust to `ir_abstract_constant_propagation` changes
serenity4 Aug 28, 2025
5a8046f
Support `invoke` CodeInstance arguments
serenity4 Aug 28, 2025
61769b4
Adjust to opaque macro behavior change
serenity4 Aug 28, 2025
16005e2
Define better slotnames for debugging
serenity4 Aug 28, 2025
2e1f87b
Fix opaque closure construction
serenity4 Sep 1, 2025
188b70f
Adjust to 1.12 opaque closure creation change
serenity4 Sep 1, 2025
497898c
More fixes
serenity4 Sep 1, 2025
aa8c925
Fix IRCode construction bug
serenity4 Sep 1, 2025
54922f2
Merge branch 'main' of github.com:chalk-lab/Mooncake.jl into copilot/…
serenity4 Sep 16, 2025
0b3548e
Adjust to binding changes for primal type extraction
serenity4 Sep 16, 2025
b59b842
Merge branch 'main' into copilot/fix-521d0edf-b6f3-4f8f-810a-9b67505e…
willtebbutt Sep 17, 2025
8ef0897
Rules for new intrinsics
willtebbutt Sep 17, 2025
d386f1a
Set appropriate world bounds on the `CodeInfo`
serenity4 Sep 22, 2025
e9ac11d
Merge branch 'main' of github.com:chalk-lab/Mooncake.jl into copilot/…
serenity4 Sep 22, 2025
b049c94
Merge branch 'main' into copilot/fix-521d0edf-b6f3-4f8f-810a-9b67505e…
yebai Oct 3, 2025
6b7210b
Merge branch 'main' into copilot/fix-521d0edf-b6f3-4f8f-810a-9b67505e…
yebai Oct 9, 2025
d4372a6
Optimize opaque closures
serenity4 Oct 10, 2025
e6e3dc1
Avoid failures on <1.12
serenity4 Oct 10, 2025
bcd9215
Don't attempt to set bounds if no inferred code is available
serenity4 Oct 10, 2025
1b052df
More <1.12 fixes
serenity4 Oct 10, 2025
726a7c2
Don't optimize if IR interp can't be performed
serenity4 Oct 10, 2025
d76e8e5
More fixes/tests
serenity4 Oct 10, 2025
90e7450
Revert use of `Base.allocations`
serenity4 Oct 10, 2025
b673282
Fix bad line info information
serenity4 Oct 14, 2025
06861b1
Make line info logic more robust, fix a few more things
serenity4 Oct 14, 2025
29d2dca
[WIP] add rules for `svec` and `_svec_len`
serenity4 Oct 14, 2025
29fe51b
Don't add _svec_len rule for < 1.12
serenity4 Oct 14, 2025
a154279
Try to avoid error in IRInterp
serenity4 Oct 16, 2025
bd7e51d
Allow type unstability for `compute_oc_signature`
serenity4 Oct 16, 2025
030d2bb
Merge branch 'main' of github.com:chalk-lab/Mooncake.jl into copilot/…
serenity4 Oct 16, 2025
d262fee
Attempt to fix allocations
serenity4 Oct 16, 2025
065b2ea
Still use the same Tuple type for < 1.12
serenity4 Oct 16, 2025
bddaf1c
Unconditionally set ir.argtypes[1] to an accurate Tuple
serenity4 Oct 16, 2025
2db7324
Fix `primal_type` bug
serenity4 Oct 16, 2025
63b6b1d
Fix construction error for IRCode
serenity4 Oct 16, 2025
6d2cad2
Fix more issues
serenity4 Oct 16, 2025
75d0c95
Discard unwanted change
serenity4 Oct 22, 2025
ea7c4da
Make version check static
serenity4 Oct 22, 2025
c3704d6
Add some @zero_derivatives for logging (#815)
mhauru Oct 23, 2025
e8d103d
Merge branch 'main' into copilot/fix-521d0edf-b6f3-4f8f-810a-9b67505e…
yebai Oct 23, 2025
bfee9d1
Update avoiding_non_differentiable_code.jl
yebai Oct 23, 2025
22992fe
fix format
yebai Oct 23, 2025
6a5c78c
Fix handle_message_nothrow @zero_derivative rule
mhauru Oct 24, 2025
864e80c
Improve a comment
mhauru Oct 24, 2025
230de34
Merge branch 'main' into copilot/fix-521d0edf-b6f3-4f8f-810a-9b67505e…
yebai Oct 30, 2025
21c1e70
Fix duplicate svec rule after merge
Technici4n Oct 30, 2025
b7d34d3
Remove JET version adjustment from CI workflow
yebai Oct 30, 2025
58a23ee
Fix typo in 1.12-
Technici4n Oct 31, 2025
18e036a
Also test buildkit and ext on 1.12?
Technici4n Nov 4, 2025
fcd7823
Use an eval to avoid duplicating BBCode
Technici4n Nov 4, 2025
9556ef3
Remove useless line (thanks Copilot)
Technici4n Nov 4, 2025
0f6b775
Update get_primal_type for GlobalRef
Technici4n Nov 4, 2025
0007df7
Update isva comment
Technici4n Nov 5, 2025
71b99c8
Require Julia 1.12.1 or newer
Technici4n Nov 5, 2025
6273382
Fix stdin reference not working in 1.11
Technici4n Nov 6, 2025
8357414
Update patch_for_319 following Julia 1.12 changes
Technici4n Nov 6, 2025
0974045
Binding partitions are lazily populated!
Technici4n Nov 6, 2025
47e383a
Set the IR's valid worlds to only the interpreter world (#832)
Technici4n Nov 6, 2025
42bc8aa
Update dispatch_doctor.jl
yebai Nov 6, 2025
dea66e6
Import _Utils from DispatchDoctor in tests
yebai Nov 6, 2025
8596b90
reformat
yebai Nov 6, 2025
827f413
Use a single world for inference
Technici4n Nov 6, 2025
3701766
Disable JET tests for Julia 1.12 temporarily.
yebai Nov 6, 2025
066f105
re-enable JET test for Julia 1.12 and format.
yebai Nov 6, 2025
d54706a
Mark compute_oc_signature as unstable
yebai Nov 6, 2025
2154677
Add documentation for resolve_unbound_globalrefs function
Copilot Nov 6, 2025
0b97be5
Add unstable block for version-specific functions
yebai Nov 6, 2025
23caf6d
Update allocation tests for Julia version compatibility
yebai Nov 6, 2025
4147d69
Update frule allocation tests for Julia version compatibility
yebai Nov 6, 2025
75299ef
refactor count_allocs
yebai Nov 6, 2025
bdeb525
Update JET version to include 0.11 (#841)
yebai Nov 9, 2025
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
3 changes: 2 additions & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ steps:
matrix:
setup:
version:
- "1.11"
- "1.10"
- "1.11"
- "1.12"
label:
- "cuda"
- "nnlib"
4 changes: 3 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
version:
- 'lts'
- '1.11'
- '1.12'
arch:
- x64
include:
Expand Down Expand Up @@ -108,8 +109,9 @@ jobs:
{test_type: 'integration_testing', label: 'flux'},
]
version:
- '1.11'
- 'lts'
- '1.11'
- '1.12'
arch:
- x64
steps:
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Flux = "0.16.3"
FunctionWrappers = "1.1.3"
GPUArraysCore = "0.1, 0.2"
Graphs = "1"
JET = "0.9, 0.10"
JET = "0.9, 0.10, 0.11"
LinearAlgebra = "1"
Logging = "1"
LuxLib = "1.11"
Expand All @@ -72,7 +72,7 @@ SpecialFunctions = "2"
StableRNGs = "1"
Static = "1.1.1"
Test = "1"
julia = "~1.10.8, 1.11.6"
julia = "~1.10.8, ~1.11.6, 1.12.1"

[extras]
AllocCheck = "9b6a8646-10ed-4001-bbdc-1d2f46dfbb1a"
Expand Down
36 changes: 27 additions & 9 deletions ext/MooncakeFunctionWrappersExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ end
function _function_wrapper_tangent(R, obj::Tobj, A, obj_tangent) where {Tobj}

# Analyse types.
_, _, fwd_sig, rvs_sig = _construct_types(R, A)
fwd_oc_type, rvs_oc_type, _, _ = _construct_types(R, A)
(fwd_sig, fwd_ret) = fwd_oc_type.parameters
(rvs_sig, rvs_ret) = rvs_oc_type.parameters

# Construct reference to obj_tangent that we can read / write-to.
obj_tangent_ref = Ref{tangent_type(Tobj)}(obj_tangent)
Expand All @@ -93,17 +95,33 @@ function _function_wrapper_tangent(R, obj::Tobj, A, obj_tangent) where {Tobj}
pb_stack = Stack{pullback_type(typeof(rule), (Tobj, A.parameters...))}()

# Construct reverse-pass. Note: this closes over `pb_stack`.
run_rvs_pass = Base.Experimental.@opaque rvs_sig dy -> begin
obj_rdata, dx... = pop!(pb_stack)(dy)
obj_tangent_ref[] = increment_rdata!!(obj_tangent_ref[], obj_rdata)
return NoRData(), dx...
@static if VERSION ≥ v"1.12-"
run_rvs_pass = Base.Experimental.@opaque rvs_sig -> rvs_ret dy -> begin
obj_rdata, dx... = pop!(pb_stack)(dy)
obj_tangent_ref[] = increment_rdata!!(obj_tangent_ref[], obj_rdata)
return NoRData(), dx...
end
else
run_rvs_pass = Base.Experimental.@opaque rvs_sig dy -> begin
obj_rdata, dx... = pop!(pb_stack)(dy)
obj_tangent_ref[] = increment_rdata!!(obj_tangent_ref[], obj_rdata)
return NoRData(), dx...
end
end

# Construct fowards-pass. Note: this closes over the reverse-pass and `pb_stack`.
run_fwds_pass = Base.Experimental.@opaque fwd_sig (x...) -> begin
y, pb = rule(CoDual(obj, fdata(obj_tangent_ref[])), x...)
push!(pb_stack, pb)
return y, run_rvs_pass
@static if VERSION ≥ v"1.12-"
run_fwds_pass = Base.Experimental.@opaque fwd_sig -> fwd_ret (x...) -> begin
y, pb = rule(CoDual(obj, fdata(obj_tangent_ref[])), x...)
push!(pb_stack, pb)
return y, run_rvs_pass
end
else
run_fwds_pass = Base.Experimental.@opaque fwd_sig (x...) -> begin
y, pb = rule(CoDual(obj, fdata(obj_tangent_ref[])), x...)
push!(pb_stack, pb)
return y, run_rvs_pass
end
end

t = FunctionWrapperTangent(run_fwds_pass, obj_tangent_ref)
Expand Down
4 changes: 2 additions & 2 deletions src/Mooncake.jl
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ include("public.jl")
end
#! format: on

@public Config, value_and_pullback!!, prepare_pullback_cache, value_and_derivative!!
@public prepare_derivative_cache, Dual
@public Config, value_and_pullback!!, prepare_pullback_cache
@public Dual

# Public, exported
export value_and_gradient!!, prepare_gradient_cache, value_and_derivative!!
Expand Down
50 changes: 40 additions & 10 deletions src/interpreter/abstract_interpretation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# in conjunction with the contexts above to decide what should be inlined and what should
# not be inlined. Similar strategies are employed by Enzyme and Diffractor.

# The most important bit of this code is `inlining_policy` -- the rest is copy + pasted
# The most important bit of this code is `inlining_policy` (renamed to `src_inlining_policy` in Julia v1.12+) -- the rest is copy + pasted
# boiler plate, largely taken from https://github.com/JuliaLang/julia/blob/2fe4190b3d26b4eee52b2b1b1054ddd6e38a941e/test/compiler/newinterp.jl#L11
#
# Credit: much of the code in here is copied over from the main Julia repo, and from
Expand Down Expand Up @@ -121,6 +121,11 @@ end
CC.nsplit_impl(info::NoInlineCallInfo) = CC.nsplit(info.info)
CC.getsplit_impl(info::NoInlineCallInfo, idx::Int) = CC.getsplit(info.info, idx)
CC.getresult_impl(info::NoInlineCallInfo, idx::Int) = CC.getresult(info.info, idx)
@static if VERSION > v"1.12-"
CC.add_edges_impl(edges::Vector{Any}, info::NoInlineCallInfo) = CC.add_edges!(
edges, info.info
)
end

function Core.Compiler.abstract_call_gf_by_type(
interp::MooncakeInterpreter{C,M},
Expand All @@ -133,7 +138,7 @@ function Core.Compiler.abstract_call_gf_by_type(
) where {C,M}

# invoke the default abstract call to get the default CC.CallMeta.
cm = @invoke CC.abstract_call_gf_by_type(
ret = @invoke CC.abstract_call_gf_by_type(
interp::CC.AbstractInterpreter,
f::Any,
arginfo::CC.ArgInfo,
Expand All @@ -142,16 +147,25 @@ function Core.Compiler.abstract_call_gf_by_type(
sv::CC.AbsIntState,
max_methods::Int,
)
is_primitive(C, M, atype) || return ret
# Insert a `NoInlineCallInfo` to prevent any potential inlining.
@static if VERSION < v"1.12-"
call = ret::CC.CallMeta
info = NoInlineCallInfo(call.info, atype)
return rewrap_callmeta(call, info)
else
return CC.Future{CC.CallMeta}(ret::CC.Future, interp, sv) do call, interp, sv
info = NoInlineCallInfo(call.info, atype)
return rewrap_callmeta(call, info)
end
end
end

# Check to see whether the call in question is a Mooncake primitive. If it is, set its
# call info such that in the `CC.inlining_policy` it is not inlined away.
callinfo = is_primitive(C, M, atype) ? NoInlineCallInfo(cm.info, atype) : cm.info

# Construct a CallMeta correctly depending on the version of Julia.
function rewrap_callmeta(call::CC.CallMeta, info::CC.CallInfo)
@static if VERSION ≥ v"1.11-"
return CC.CallMeta(cm.rt, cm.exct, cm.effects, callinfo)
return CC.CallMeta(call.rt, call.exct, call.effects, info)
else
return CC.CallMeta(cm.rt, cm.effects, callinfo)
return CC.CallMeta(call.rt, call.effects, info)
end
end

Expand Down Expand Up @@ -179,7 +193,7 @@ end
)
end

else # 1.11 and up.
elseif VERSION < v"1.12-" # 1.11
function CC.inlining_policy(
interp::MooncakeInterpreter,
@nospecialize(src),
Expand All @@ -194,6 +208,22 @@ else # 1.11 and up.
interp::CC.AbstractInterpreter, src::Any, info::CC.CallInfo, stmt_flag::UInt32
)
end

else # 1.12 and up.
function CC.src_inlining_policy(
interp::MooncakeInterpreter,
@nospecialize(src),
@nospecialize(info::CC.CallInfo),
stmt_flag::UInt32,
)
# Do not inline away primitives.
info isa NoInlineCallInfo && return false

# If not a primitive, AD doesn't care about it. Use the usual inlining strategy.
return @invoke CC.src_inlining_policy(
interp::CC.AbstractInterpreter, src::Any, info::CC.CallInfo, stmt_flag::UInt32
)
end
end

"""
Expand Down
166 changes: 109 additions & 57 deletions src/interpreter/bbcode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -272,45 +272,57 @@ These should be assumed to be ordered.
"""
collect_stmts(bb::BBlock)::Vector{IDInstPair} = collect(zip(bb.inst_ids, bb.insts))

"""
BBCode(
@eval begin
"""
BBCode(
blocks::Vector{BBlock}
argtypes::Vector{Any}
sptypes::Vector{CC.VarState}
linetable::Vector{Core.LineInfoNode} (v1.11 and lower)
debuginfo::CC.DebugInfoStream (v1.12+)
meta::Vector{Expr}
valid_worlds::CC.WorldRange (v1.12+)
)

A `BBCode` is a data structure which is similar to `IRCode`, but adds additional structure.

In particular, a `BBCode` comprises a sequence of basic blocks (`BBlock`s), each of which
comprise a sequence of statements. Moreover, each `BBlock` has its own unique `ID`, as does
each statment.

The consequence of this is that new basic blocks can be inserted into a `BBCode`. This is
distinct from `IRCode`, in which to create a new basic block, one must insert additional
statments which you know will create a new basic block -- this is generally quite an
unreliable process, while inserting a new `BBlock` into `BBCode` is entirely predictable.
Furthermore, inserting a new `BBlock` does not change the `ID` associated to the other
blocks, meaning that you can safely assume that references from existing basic block
terminators / phi nodes to other blocks will not be modified by inserting a new basic block.

Additionally, since each statment in each basic block has its own unique `ID`, new
statments can be inserted without changing references between other blocks. `IRCode` also
has some support for this via its `new_nodes` field, but eventually all statements will be
renamed upon `compact!`ing the `IRCode`, meaning that the name of any given statement will
eventually change.

Finally, note that the basic blocks in a `BBCode` support the custom `Switch` statement.
This statement is not valid in `IRCode`, and is therefore lowered into a collection of
`GotoIfNot`s and `GotoNode`s when a `BBCode` is converted back into an `IRCode`.
"""
struct BBCode
blocks::Vector{BBlock}
argtypes::Vector{Any}
sptypes::Vector{CC.VarState}
linetable::Vector{Core.LineInfoNode}
$(
if VERSION > v"1.12-"
:(debuginfo::CC.DebugInfoStream)
else
:(linetable::Vector{Core.LineInfoNode})
end
)
meta::Vector{Expr}
)

A `BBCode` is a data structure which is similar to `IRCode`, but adds additional structure.

In particular, a `BBCode` comprises a sequence of basic blocks (`BBlock`s), each of which
comprise a sequence of statements. Moreover, each `BBlock` has its own unique `ID`, as does
each statment.

The consequence of this is that new basic blocks can be inserted into a `BBCode`. This is
distinct from `IRCode`, in which to create a new basic block, one must insert additional
statments which you know will create a new basic block -- this is generally quite an
unreliable process, while inserting a new `BBlock` into `BBCode` is entirely predictable.
Furthermore, inserting a new `BBlock` does not change the `ID` associated to the other
blocks, meaning that you can safely assume that references from existing basic block
terminators / phi nodes to other blocks will not be modified by inserting a new basic block.

Additionally, since each statment in each basic block has its own unique `ID`, new
statments can be inserted without changing references between other blocks. `IRCode` also
has some support for this via its `new_nodes` field, but eventually all statements will be
renamed upon `compact!`ing the `IRCode`, meaning that the name of any given statement will
eventually change.

Finally, note that the basic blocks in a `BBCode` support the custom `Switch` statement.
This statement is not valid in `IRCode`, and is therefore lowered into a collection of
`GotoIfNot`s and `GotoNode`s when a `BBCode` is converted back into an `IRCode`.
"""
struct BBCode
blocks::Vector{BBlock}
argtypes::Vector{Any}
sptypes::Vector{CC.VarState}
linetable::Vector{Core.LineInfoNode}
meta::Vector{Expr}
$(VERSION > v"1.12-" ? :(valid_worlds::CC.WorldRange) : nothing)
end
export BBCode
end

"""
Expand All @@ -319,14 +331,27 @@ end
Make a new `BBCode` whose `blocks` is given by `new_blocks`, and fresh copies are made of
all other fields from `ir`.
"""
function BBCode(ir::Union{IRCode,BBCode}, new_blocks::Vector{BBlock})
return BBCode(
new_blocks,
CC.copy(ir.argtypes),
CC.copy(ir.sptypes),
CC.copy(ir.linetable),
CC.copy(ir.meta),
)
@static if VERSION > v"1.12-"
function BBCode(ir::Union{IRCode,BBCode}, new_blocks::Vector{BBlock})
return BBCode(
new_blocks,
CC.copy(ir.argtypes),
CC.copy(ir.sptypes),
CC.copy(ir.debuginfo),
CC.copy(ir.meta),
ir.valid_worlds,
)
end
else
function BBCode(ir::Union{IRCode,BBCode}, new_blocks::Vector{BBlock})
return BBCode(
new_blocks,
CC.copy(ir.argtypes),
CC.copy(ir.sptypes),
CC.copy(ir.linetable),
CC.copy(ir.meta),
)
end
end

# Makes use of the above outer constructor for `BBCode`.
Expand Down Expand Up @@ -640,20 +665,47 @@ function CC.IRCode(bb_code::BBCode)
insts = _ids_to_line_numbers(bb_code)
cfg = control_flow_graph(bb_code)
insts = _lines_to_blocks(insts, cfg)
return IRCode(
CC.InstructionStream(
map(x -> x.stmt, insts),
map(x -> x.type, insts),
map(x -> x.info, insts),
map(x -> x.line, insts),
map(x -> x.flag, insts),
),
cfg,
CC.copy(bb_code.linetable),
CC.copy(bb_code.argtypes),
CC.copy(bb_code.meta),
CC.copy(bb_code.sptypes),
)
@static if VERSION > v"1.12-"
lines = CC.copy(bb_code.debuginfo.codelocs)
n = length(insts)
if length(lines) > 3n
resize!(lines, 3n)
elseif length(lines) < 3n
for _ in (length(lines) + 1):3n
push!(lines, 0)
end
end
Comment on lines +669 to +677
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would be the situations where the length of lines is incorrect such that we have to resize it?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect that new_inst_vec needs an update as well.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For 1.11 and below, we expect as many integers as there are instructions, say n. For 1.12 and above, we expect three times as much, essentially the format moved from a single integer to a "tuple" of three integers but in a flattened way so we get a vector of size 3n.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there cases where the vector is not properly 3n-sized?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The resize logic is defensive programming to ensure robustness. In Julia 1.12+, debuginfo.codelocs is expected to be a flattened vector of length 3n (representing triplets of line information for each of n instructions). While in most cases it should already be correctly sized, this code handles edge cases where it might not be, ensuring IR construction never fails due to size mismatches. Regarding new_inst_vec, it already correctly handles the instruction stream conversion on both Julia versions - the map operation properly extracts fields including the line information which is handled separately in the IRCode construction.

return IRCode(
CC.InstructionStream(
Any[x.stmt for x in insts],
Any[x.type for x in insts],
CC.CallInfo[x.info for x in insts],
lines,
UInt32[x.flag for x in insts],
),
cfg,
CC.copy(bb_code.debuginfo),
CC.copy(bb_code.argtypes),
CC.copy(bb_code.meta),
CC.copy(bb_code.sptypes),
bb_code.valid_worlds,
)
else
return IRCode(
CC.InstructionStream(
Any[x.stmt for x in insts],
Any[x.type for x in insts],
CC.CallInfo[x.info for x in insts],
Int32[x.line for x in insts],
UInt32[x.flag for x in insts],
),
cfg,
CC.copy(bb_code.linetable),
CC.copy(bb_code.argtypes),
CC.copy(bb_code.meta),
CC.copy(bb_code.sptypes),
)
end
end

"""
Expand Down
Loading
Loading