Stream: git-wasmtime

Topic: wasmtime / Issue #1191 Add tool to generate human-readabl...


view this post on Zulip Wasmtime GitHub notifications bot (Mar 05 2020 at 15:30):

bjorn3 commented on Issue #1191:

I think it was #1113.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 05 2020 at 21:41):

abrown commented on Issue #1191:

Why do we want this?

When adding new instructions to Cranelift, I have frequently found errors of the "no encoding found" sort. Sometimes a type is not bound correctly, sometimes a predicate is preventing the compiler from seeing the encoding, sometimes the instruction is in the wrong CPU mode, etc. Looking through the generated Rust code to figure out why no encoding is found is very difficult, mostly because of the lookup table structures. If we could at least see a list of all encodings, their recipes, types, and (eventually) predicates, then we could more quickly troubleshoot the above errors.

I don't have all the information that might be useful in this PR (e.g. predicates) but I was trying to get something in place and then iterate. I am displaying the information I care about--is there something else that should be added? Or is a different format more helpful?

Is there a way we could not generate this by default?

Yes, we could. I like the idea of adding a clif-util encodings command to print this information to stdout and then the user can do what they want with it. Does that sound good?

view this post on Zulip Wasmtime GitHub notifications bot (Mar 06 2020 at 10:24):

bnjbvr commented on Issue #1191:

I don't have all the information that might be useful in this PR (e.g. predicates) but I was trying to get something in place and then iterate. I am displaying the information I care about--is there something else that should be added? Or is a different format more helpful?

This sounds good as a first iteration!

adding a clif-util encodings command to print this information to stdout and then the user can do what they want with it. Does that sound good?

Sounds good to me too!

view this post on Zulip Wasmtime GitHub notifications bot (Mar 10 2020 at 16:48):

abrown commented on Issue #1191:

@bnjbvr, looking at this again today and I realized that if we add a clif-util encodings command then we will end up having to write some information out somewhere (a text file, a Rust file, etc.) during the compilation of cranelift-codegen. That sort of defeats the purpose of avoiding a compile-time cost so I wanted to confirm we still want to do this. I measured it and when I tried cargo clean && cargo build -p cranelift-codegen -vv I see a total compile time of ~34s and of that this listing code takes ~14ms. That doesn't seem over-large but we could still put it behind a feature flag for users who may want to disable it, though I would think this would be the type of thing that could be enabled by default.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 12 2020 at 17:11):

github-actions[bot] commented on Issue #1191:

Subscribe to Label Action

This issue or pull request has been labeled: "c", "r", "a", "n", "e", "l", "i", "f", "t"

To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.

Learn more.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 12 2020 at 17:11):

github-actions[bot] commented on Issue #1191:

Subscribe to Label Action

This issue or pull request has been labeled: "c", "r", "a", "n", "e", "l", "i", "f", "t"

To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.

Learn more.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 17 2020 at 10:52):

github-actions[bot] commented on Issue #1191:

Subscribe to Label Action

This issue or pull request has been labeled: "cranelift", "cranelift:meta"

<details> <summary>Users Subscribed to "cranelift"</summary>

</details>

To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.

Learn more.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 27 2020 at 17:12):

abrown commented on Issue #1191:

@bnjbvr, thanks for reviewing... but I probably should have closed this: yes, this will likely not be necessary with the new backend. It is solving a problem introduced at the meta-level (e.g. why is cranelift telling me that it can't find an encoding for this instruction?!?) which the new backend may not have. I'll re-open and modify as needed if I am still running into that type of issue once I am a bit more familiar with the new backend.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 27 2020 at 17:43):

bjorn3 commented on Issue #1191:

The new backend just uses a big match on the instruction. If there is an instruction without encoding, it panics.


Last updated: Dec 23 2024 at 12:05 UTC