cfallin requested iximeow for a review on PR #2929.
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.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
bjorn3 submitted PR review.
bjorn3 created PR review comment:
Can this be a
PrimaryMap
fromBlock
toCodeOffset
?
bjorn3 edited PR review comment.
cfallin updated PR #2929 from bb-offsets
to main
.
cfallin submitted PR review.
cfallin created PR review comment:
Yes, that makes more sense, I agree; updated. Thanks!
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.
bjorn3 submitted PR review.
cfallin updated PR #2929 from bb-offsets
to main
.
cfallin submitted PR review.
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 connectBlock
s toCodeOffset
s we could definitely extend this, but I would want to think about the types and how to make it safer to use first.
cfallin updated PR #2929 from bb-offsets
to main
.
iximeow submitted PR review.
iximeow created PR review comment:
i see you said "updated" but it's still
Vec<CodeOffset>
in the PR ... missing commit somewhere?
iximeow submitted PR review.
iximeow created PR review comment:
oh i sse the other resolved conversation about this, disregard!
iximeow submitted PR review.
cfallin updated PR #2929 from bb-offsets
to main
.
cfallin merged PR #2929.
Last updated: Nov 22 2024 at 16:03 UTC