You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Caution: I don't actually have any benchmarks here. So this would need to be undertaken along with adding a compaction benchmark to our criterion benchmark suite.
If compaction took advantage of the fact that expressions, constants, and types only refer to elements earlier in the arena than they are, it could trace these by making a single pass from end to start, marking (say) an expression's operands as used only if the expression itself is marked used.
To trace a function, you'd first trace the statement tree, but for each expression the statement tree refers to, you'd simply mark it used - you would not call trace_expression.
Then, after the statement tree has been traced, you'd make a single pass over the expression arena from back to front, marking an expression's operands as used only if the expression itself had been marked as used previously. This would require no work list manipulation.
A similar approach could be extended to the constants, constant expressions, and types.
Unlike the current algorithm, this would require traversing both live and dead arena elements. However, that traversal would be guided by the contents of the HandleSets, so that we wouldn't ever actually touch the elements we didn't intend to traverse.
The text was updated successfully, but these errors were encountered:
Caution: I don't actually have any benchmarks here. So this would need to be undertaken along with adding a compaction benchmark to our
criterion
benchmark suite.If compaction took advantage of the fact that expressions, constants, and types only refer to elements earlier in the arena than they are, it could trace these by making a single pass from end to start, marking (say) an expression's operands as used only if the expression itself is marked used.
To trace a function, you'd first trace the statement tree, but for each expression the statement tree refers to, you'd simply mark it used - you would not call
trace_expression
.Then, after the statement tree has been traced, you'd make a single pass over the expression arena from back to front, marking an expression's operands as used only if the expression itself had been marked as used previously. This would require no work list manipulation.
A similar approach could be extended to the constants, constant expressions, and types.
Unlike the current algorithm, this would require traversing both live and dead arena elements. However, that traversal would be guided by the contents of the
HandleSet
s, so that we wouldn't ever actually touch the elements we didn't intend to traverse.The text was updated successfully, but these errors were encountered: