Skip to content

Commit f9dc722

Browse files
authored
rename is_concrete_eval_eligible utility query to is_foldable (#45615)
`is_foldable` should be more aligned with `Base.@assume_effects`. This should be backported to 1.8 also.
1 parent 9f26d5c commit f9dc722

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

base/compiler/abstractinterpretation.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ function concrete_eval_eligible(interp::AbstractInterpreter,
746746
isoverlayed(method_table(interp)) && !is_nonoverlayed(result.edge_effects) && return false
747747
return f !== nothing &&
748748
result.edge !== nothing &&
749-
is_concrete_eval_eligible(result.edge_effects) &&
749+
is_foldable(result.edge_effects) &&
750750
is_all_const_arg(arginfo)
751751
end
752752

base/compiler/types.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,13 @@ is_notaskstate(effects::Effects) = effects.notaskstate === ALWAYS_TRUE
125125
is_nonoverlayed(effects::Effects) = effects.nonoverlayed
126126

127127
# implies :notaskstate, but not explicitly checked here
128-
is_concrete_eval_eligible(effects::Effects) =
128+
is_foldable(effects::Effects) =
129129
is_consistent(effects) &&
130130
is_effect_free(effects) &&
131131
is_terminates(effects)
132132

133133
is_total(effects::Effects) =
134-
is_concrete_eval_eligible(effects) &&
134+
is_foldable(effects) &&
135135
is_nothrow(effects)
136136

137137
is_removable_if_unused(effects::Effects) =

test/broadcast.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1119,4 +1119,4 @@ end
11191119
# test that `Broadcast` definition is defined as total and eligible for concrete evaluation
11201120
import Base.Broadcast: BroadcastStyle, DefaultArrayStyle
11211121
@test Base.infer_effects(BroadcastStyle, (DefaultArrayStyle{1},DefaultArrayStyle{2},)) |>
1122-
Core.Compiler.is_concrete_eval_eligible
1122+
Core.Compiler.is_foldable

test/compiler/inference.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4130,14 +4130,14 @@ function entry_to_be_invalidated(c)
41304130
end
41314131
@test Base.infer_effects((Char,)) do x
41324132
entry_to_be_invalidated(x)
4133-
end |> Core.Compiler.is_concrete_eval_eligible
4133+
end |> Core.Compiler.is_foldable
41344134
@test fully_eliminated(; retval=97) do
41354135
entry_to_be_invalidated('a')
41364136
end
41374137
getcharid(c) = CONST_DICT[c] # now this is not eligible for concrete evaluation
41384138
@test Base.infer_effects((Char,)) do x
41394139
entry_to_be_invalidated(x)
4140-
end |> !Core.Compiler.is_concrete_eval_eligible
4140+
end |> !Core.Compiler.is_foldable
41414141
@test !fully_eliminated() do
41424142
entry_to_be_invalidated('a')
41434143
end

0 commit comments

Comments
 (0)