Skip to content

Commit

Permalink
Only update eclass analysis if the new analysis != nothing
Browse files Browse the repository at this point in the history
  • Loading branch information
gkronber committed Sep 10, 2024
1 parent 8cc9c88 commit 2653075
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/EGraphs/egraph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -426,21 +426,22 @@ function process_unions!(g::EGraph{ExpressionType,AnalysisType})::Int where {Exp
eclass = g.classes[eclass_id_key]

node_data = make(g, node)
if !isnothing(eclass.data)
joined_data = join(eclass.data, node_data)

if joined_data != eclass.data
g.classes[eclass_id_key] = EClass{AnalysisType}(eclass_id, eclass.nodes, eclass.parents, joined_data)
# eclass.data = joined_data
if !isnothing(node_data)
if !isnothing(eclass.data)
joined_data = join(eclass.data, node_data)

if joined_data != eclass.data
g.classes[eclass_id_key] = EClass{AnalysisType}(eclass_id, eclass.nodes, eclass.parents, joined_data)
# eclass.data = joined_data
modify!(g, eclass)
append!(g.analysis_pending, eclass.parents)
end
else
g.classes[eclass_id_key] = EClass{AnalysisType}(eclass_id, eclass.nodes, eclass.parents, node_data)
# eclass.data = node_data
modify!(g, eclass)
append!(g.analysis_pending, eclass.parents)
end
else
g.classes[eclass_id_key] = EClass{AnalysisType}(eclass_id, eclass.nodes, eclass.parents, node_data)
# eclass.data = node_data
modify!(g, eclass)
end

end
end
n_unions
Expand Down

1 comment on commit 2653075

@gkronber
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Please sign in to comment.