Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
9d8528c
Adapt to https://github.com/JuliaLang/julia/pull/56509
serenity4 Feb 20, 2025
d8fb471
Adapt to https://github.com/JuliaLang/julia/pull/54734
serenity4 Feb 20, 2025
5cd9f67
Use StmtRange explicitly
serenity4 Feb 20, 2025
524ac00
Adapt to https://github.com/JuliaLang/julia/pull/57230
serenity4 Feb 20, 2025
edcd439
Reuse Cthulhu code structure for Compiler cache/finish overrides
serenity4 Feb 20, 2025
a150d87
Adapt to https://github.com/JuliaLang/julia/issues/57475
serenity4 Feb 21, 2025
1e1ad26
Adapt to https://github.com/JuliaLang/julia/issues/55976
serenity4 Feb 21, 2025
4190f6f
Adapt to https://github.com/JuliaLang/julia/pull/54734
serenity4 Feb 21, 2025
48d764d
Use CC instead of .Compiler
serenity4 Feb 21, 2025
35cde4c
Implement ir.argtypes[1] fix from https://github.com/JuliaLang/julia/…
serenity4 Feb 21, 2025
7b7b757
Comment out failing tests
serenity4 Feb 21, 2025
dc6746e
Treat `getproperty(::Module, ::Symbol)` like GlobalRefs
serenity4 Feb 21, 2025
4c2bca7
Uncomment passing tests, explicitly mark others as broken
serenity4 Feb 21, 2025
7f126aa
Evaluate GlobalRef only if binding is defined
serenity4 Feb 24, 2025
ac7bce4
Use `rrule` for getproperty(::Module, ::Symbol)
serenity4 Feb 24, 2025
ac83f33
Bump compat bound for StructArrays
serenity4 Feb 24, 2025
590815a
Raise compat bound for Cthulhu
serenity4 Feb 24, 2025
310e4f7
Revert `isconst` change now that it is fixed
serenity4 Feb 28, 2025
afd50a0
Adapt to `finishinfer!` signature change
serenity4 Feb 28, 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
Prev Previous commit
Next Next commit
Evaluate GlobalRef only if binding is defined
  • Loading branch information
serenity4 committed Feb 24, 2025
commit 7f126aa53fb43f96bbf9bd2fce27369c579bf01c
11 changes: 9 additions & 2 deletions src/codegen/reverse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -683,13 +683,20 @@ function diffract_ir!(ir, ci, meth, sparams::Core.SimpleVector, nargs::Int, N::I
end

eval_globalref(x) = x
eval_globalref(x::GlobalRef) = getglobal(x.mod, x.name)
function eval_globalref(ref::GlobalRef)
isdefined(ref.mod, ref.name) || return nothing
getproperty(ref.mod, ref.name)
end
ssa_def(ir, idx::SSAValue) = ssa_def(ir, ir[idx][:inst])
ssa_def(ir, def) = def

function is_global_access(ir::Union{IRCode,IncrementalCompact}, stmt)
isexpr(stmt, :call, 3) || return false
f = eval_globalref(ssa_def(ir, stmt.args[1]))
f = ssa_def(ir, stmt.args[1])
if isa(f, GlobalRef)
f.name === :getproperty || return false
f = eval_globalref(f)
end
f === getproperty || return false
from = eval_globalref(ssa_def(ir, stmt.args[2]))
isa(from, Module) || return false
Expand Down
Loading