Stream: git-wasmtime

Topic: wasmtime / PR #2929 Provide BB layout info externally in ...


view this post on Zulip Wasmtime GitHub notifications bot (May 24 2021 at 16:19):

cfallin requested iximeow for a review on PR #2929.

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2021 at 16:19):

cfallin opened PR #2929 from bb-offsets to main:

This is sometimes useful when performing analyses on the generated
machine code: for example, some kinds of code verifiers will want to do
a control-flow analysis, and it is much easier to do this if one does
not have to recover the CFG from the machine code (doing so requires
heavyweight analysis when indirect branches are involved). If one trusts
the control-flow lowering and only needs to verify other properties of
the code, this can be very useful.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2021 at 16:23):

bjorn3 submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2021 at 16:23):

bjorn3 created PR review comment:

Can this be a PrimaryMap from Block to CodeOffset?

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2021 at 16:23):

bjorn3 edited PR review comment.

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2021 at 17:18):

cfallin updated PR #2929 from bb-offsets to main.

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2021 at 17:19):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2021 at 17:19):

cfallin created PR review comment:

Yes, that makes more sense, I agree; updated. Thanks!

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2021 at 17:35):

bjorn3 created PR review comment:

This doesn't exactly correspond with cranelift ir level blocks, right? That was my suggestion. And now that I think about it you may need to use SecondaryMap to be able to use the right index.

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2021 at 17:35):

bjorn3 submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2021 at 17:42):

cfallin updated PR #2929 from bb-offsets to main.

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2021 at 17:46):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2021 at 17:46):

cfallin created PR review comment:

Ah, actually, now that I page this back in, I realize that it probably makes more sense not to try to provide a mapping from Cranelift-level blocks to machine code offsets.

The reason is that blocks can be reordered, sometimes prepended or appended with edge blocks, or elided completely. The intent of this change is to instead provide an independent CFG overlay on the final code that can be used for further analysis; the use-case it's built for (VeriWasm, specifically) doesn't need the correspondence with the CLIF-level CFG.

So I've reverted this back to the Vec<CodeOffset>. If we later want to connect Blocks to CodeOffsets we could definitely extend this, but I would want to think about the types and how to make it safer to use first.

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2021 at 18:17):

cfallin updated PR #2929 from bb-offsets to main.

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2021 at 19:06):

iximeow submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2021 at 19:06):

iximeow created PR review comment:

i see you said "updated" but it's still Vec<CodeOffset> in the PR ... missing commit somewhere?

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2021 at 19:06):

iximeow submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2021 at 19:06):

iximeow created PR review comment:

oh i sse the other resolved conversation about this, disregard!

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2021 at 19:07):

iximeow submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2021 at 20:01):

cfallin updated PR #2929 from bb-offsets to main.

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2021 at 21:27):

cfallin merged PR #2929.


Last updated: Nov 22 2024 at 16:03 UTC