Skip to content
Open
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
5 changes: 3 additions & 2 deletions Compiler/src/abstractinterpretation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3691,7 +3691,7 @@ end

function scan_specified_partitions(query::F1, walk_binding_partition::F2,
interp::Union{AbstractInterpreter,Nothing}, g::GlobalRef, wwr::WorldWithRange) where {F1,F2}
local total_validity, rte, binding_partition
local total_validity, rte, binding_partition, kind
binding = convert(Core.Binding, g)
lookup_world = max_world(wwr.valid_worlds)
while true
Expand All @@ -3704,7 +3704,7 @@ function scan_specified_partitions(query::F1, walk_binding_partition::F2,
@assert lookup_world in partition_validity
this_rte = query(interp, leaf_binding, leaf_partition)
if @isdefined(rte)
if this_rte === rte
if this_rte === rte && !(is_some_guard(kind) ⊻ is_some_guard(binding_kind(leaf_partition))) # Don't merge from no guard to guard
Copy link
Member

Choose a reason for hiding this comment

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

The same check should apply to backdated const, which needs to be treated uniformly with guard.

Copy link
Member Author

Choose a reason for hiding this comment

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

should is_some_guard be true for it?

Copy link
Member

Choose a reason for hiding this comment

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

No, it's not a guard, but there should an is_backdated, which #59735 does add.

total_validity = union(total_validity, partition_validity)
lookup_world = min_world(total_validity) - 1
continue
Expand All @@ -3716,6 +3716,7 @@ function scan_specified_partitions(query::F1, walk_binding_partition::F2,
total_validity = partition_validity
lookup_world = min_world(total_validity) - 1
rte = this_rte
kind = binding_kind(leaf_partition)
end
min_world(total_validity) > min_world(wwr.valid_worlds) || break
end
Expand Down
8 changes: 8 additions & 0 deletions Compiler/test/codegen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1075,3 +1075,11 @@ let io = IOBuffer()
str = String(take!(io))
@test occursin("julia.write_barrier", str)
end

f42559 = 5
foo42559() = f42559
let io = IOBuffer()
code_llvm(io, foo42559, Tuple{}, raw=true, optimize=false)
str = String(take!(io))
@test !occursin("jl_get_binding_value_seqcst", str)
end