Skip to content

Move jump tables to the DataFlowGraph#5745

Merged
elliottt merged 1 commit intobytecodealliance:mainfrom
elliottt:trevor/jump-tables
Feb 8, 2023
Merged

Move jump tables to the DataFlowGraph#5745
elliottt merged 1 commit intobytecodealliance:mainfrom
elliottt:trevor/jump-tables

Conversation

@elliottt
Copy link
Member

@elliottt elliottt commented Feb 8, 2023

Move the storage for jump tables off of FunctionStencil and onto DataFlowGraph. This change is in service of #5731, making it easier to access the jump table data in the context of helpers like inst_values.

Moving the jump table data to DataFlowGraph is reasonable, as we are now assuming in more than one place that a jump table entry is used by at most one br_table instruction. As such, it's now more instruction side-data, rather than function side-data, and makes more sense to store in the DataFlowGraph.

One open question I have is whether or not we should lock down the interface to DataFlowGraph::jump_tables in the same way that we have insts and blocks. There could be some value in restricting it, but as we didn't when it was public on FunctionStencil, I left it as a PrimaryMap.

Copy link
Contributor

@jameysharp jameysharp left a comment

Choose a reason for hiding this comment

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

Seems like a sound move to me!

@elliottt elliottt marked this pull request as ready for review February 8, 2023 01:18
@github-actions github-actions bot added the cranelift Issues related to the Cranelift code generator label Feb 8, 2023
@elliottt elliottt merged commit b0b3f67 into bytecodealliance:main Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cranelift Issues related to the Cranelift code generator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants