Skip to content

Dedicated operation for general CFG, for the loop/switch case. #371

Closed

Description

While I support producers working hard to avoid the use of loop/switch, it does not appear to be avoidable with the current constraints, and the changes in #299 do not appear to make any change to the need for loop/switch based on my reading of the discussion so it will remain as frequent as for asm.js.

Some wasm runtimes would be expected to be able to handle general CFGs from the start, such as runtimes using llvm as a backend, and these could usefully recognize the loop/switch pattern and use jump threading to convert it to a CFG. Perhaps moving forward more runtimes will handle this well too, so the use of loop/switch in code will become baggage.

If code is going to need to fall back to using loop/switch for some CFGs, and given that at least some consumers can optimize this well, then I suggest a separate operation for this pattern that is easier to recognize, an operation that would be understood to emit a loop/switch if the compiler did not support general CFGs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions