[CodeAnnotations] Implement function-level inlining hints#8265
[CodeAnnotations] Implement function-level inlining hints#8265kripken merged 13 commits intoWebAssembly:mainfrom
Conversation
| auto offset = exprOffset - funcDeclarationsOffset; | ||
| // Compute the offset: it should be relative to the start of the | ||
| // function locals (i.e. the function declarations). | ||
| offset = exprOffset - funcDeclarationsOffset; |
There was a problem hiding this comment.
Does this expression offset ever end up being 0 as well?
There was a problem hiding this comment.
It can't be 0 - the function has something at offset 0 (the number of locals, even if has no locals, that will take a byte for "0"). This is why we decided it was safe to use offset 0 in the spec.
test/lit/inline-hints-func.wast
Outdated
| ;; RUN: wasm-opt -all %s -S -o - | filecheck %s | ||
| ;; RUN: wasm-opt -all --roundtrip %s -S -o - | filecheck %s |
There was a problem hiding this comment.
Can we move the RUN lines to the top of the file for consistency with other tests? I was about to leave a comment asking how it was possible that there were no RUN lines here before I found them 😅
| (@metadata.code.inline "\12") | ||
| (func $func-annotation | ||
| ;; The annotation here is on the function. | ||
| (drop |
There was a problem hiding this comment.
Related to my question about the offsets, can we properly roundtrip an annotation on the first expression in a function?
There was a problem hiding this comment.
Yes, and we test that, see e.g.
binaryen/test/lit/inline-hints.wast
Line 43 in 9acdd65
This is the first function-level annotation, so this includes some
necessary fixes for that.
Diff without whitespace is smaller.