Stream: cranelift

Topic: reducible cfgs?


view this post on Zulip Andy Wingo (Dec 08 2021 at 14:01):

Hello people! Quick question -- does cranelift require reducible control-flow graphs?

view this post on Zulip bjorn3 (Dec 08 2021 at 14:35):

Cranelift doesn't require it.

view this post on Zulip Andy Wingo (Dec 08 2021 at 14:39):

cool, tx. (also how do you know? wasm graphs won't contain these initially; you can only get them after jump threading or such...)

view this post on Zulip Andy Wingo (Dec 08 2021 at 14:40):

context is i was thinking of having a poke at funclets or similar idioms

view this post on Zulip bjorn3 (Dec 08 2021 at 14:41):

rustc_codegen_cranelift doesn't turn potentially irreducable control flow from rustc MIR into reducable control flow when generating cranelift ir

view this post on Zulip bjorn3 (Dec 08 2021 at 14:41):

I never got any issues from this.

view this post on Zulip bjorn3 (Dec 08 2021 at 14:42):

Andy Wingo said:

context is i was thinking of having a poke at funclets or similar idioms

that isn't supported by cranelift ir yet

view this post on Zulip Andy Wingo (Dec 08 2021 at 14:44):

that's why i was thinking of having a poke at it

view this post on Zulip bjorn3 (Dec 08 2021 at 14:46):

Have you seen https://github.com/bytecodealliance/wasmtime/issues/3427, https://github.com/bytecodealliance/wasmtime/issues/2049 and https://github.com/bytecodealliance/wasmtime/issues/1677?

I've been interested in having the Exception Handling proposal supported in Wasmtime, so I looked into possible ways to implement it. There's been some prior discussion in issues #2049 and ...
Feature Cranelift currently doesn't support SEH (but has some support for finally I think). This is a feature request to support properly exception (landingpads on Posix, SEH on windows, maybe ...
Feature Currently the generated unwinding information only restores registers. This issue proposes to make it possible to also run cleanup actions like running destructors during unwinding. Benefit...

view this post on Zulip Andy Wingo (Dec 08 2021 at 14:48):

no i had not, thank you for those pointers!

view this post on Zulip bjorn3 (Dec 08 2021 at 14:50):

https://github.com/bjorn3/wasmtime/tree/eh_cleanup was an experiment of mine for implementing it. Never finished it though.

Standalone JIT-style runtime for WebAssembly, using Cranelift - GitHub - bjorn3/wasmtime at eh_cleanup

view this post on Zulip Chris Fallin (Dec 08 2021 at 16:44):

@Andy Wingo to add some confirmation here, the backend parts (regalloc, cfg lowering to branches) were explicitly designed to handle irreducible control flow, and if there's something that breaks with it, I'd consider it a bug; happy to jump on any issues that arise!


Last updated: Dec 23 2024 at 12:05 UTC