Closed dpsanders closed 6 years ago
Basically this is the difference:
julia> t[2], t[3,2]
(IVertex(x ^ 2), IVertex(x ^ 2))
julia> t[2] === t[3,2]
false
julia> t2[2] === t2[3,2]
true
The x^2
nodes are always embedded directly, so we'll never see a variable binding, just the expression. Two expressions are considered the same when they are ===
identical, so the second case gets an explicit variable binding.
Ah, I think I see, thanks !
I think DataFlow.syntax
was what I was looking for:
julia> DataFlow.syntax(t)
quote
(x ^ 2, x ^ 2 + 2)
end
julia> DataFlow.syntax(t2)
quote
##edge#662 = x ^ 2
(##edge#662, ##edge#662 + 2)
end
I would like to extract the CSE form of an expression, but I can't work out how. I don't see any difference before and after CSE (e.g. in the resulting types of the objects).
Somehow the package knows that they are different (since it displays them differently), but in all other respects they seem to be identical.