Stream: git-wasmtime

Topic: wasmtime / Issue #1134 Use more type-inference to reduce ...


view this post on Zulip Wasmtime GitHub notifications bot (Feb 03 2021 at 18:22):

bjorn3 commented on Issue #1134:

The new backend framework doesn't use legalizations as much as the old backend framework anymore.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 03 2021 at 18:43):

cfallin closed Issue #1134:

Currently, when we have an instruction that requires legalizations for several types, and the legalization is the same modulo the types involved, we'll create one legalization for each type, and will bind the source instruction to the type.

It's actually a shame, because the meta crate implements type inference and can do better than this: for instance, if the instruction you're legalizing accepts types in a set S, then it could be able to generate all the legalizations for types in S as one legalization, and not one per type.

We could switch to use the type inference a bit more. One drawback I can think of is that it would make it harder to find which legalizations handle which types. It's still possible to look at the generated source files, though, so that's a minor problem.

For what it's worth, I've already implemented it, since I thought I found a bug in the type inference code (it was just never triggered, and has existed as long as type inference existed in Cranelift). Branch is there and diff of generated code is there.


Last updated: Oct 23 2024 at 20:03 UTC