-
Notifications
You must be signed in to change notification settings - Fork 836
[CodeAnnotations] Implement function-level inlining hints #8265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
eec2e84
8ea8573
5be13af
0439ae5
4f78c61
f227d6a
5e7e6ff
d568043
792b3a1
08ccef1
0a6639e
8cd528c
2737fea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -0,0 +1,23 @@ | ||||
| ;; RUN: wasm-opt -all %s -S -o - | filecheck %s | ||||
| ;; RUN: wasm-opt -all --roundtrip %s -S -o - | filecheck %s | ||||
|
|
||||
| (module | ||||
| (@metadata.code.inline "\12") | ||||
| (func $func-annotation | ||||
| ;; The annotation here is on the function. | ||||
| (drop | ||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Related to my question about the offsets, can we properly roundtrip an annotation on the first expression in a function?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, and we test that, see e.g. binaryen/test/lit/inline-hints.wast Line 43 in 9acdd65
|
||||
| (i32.const 0) | ||||
| ) | ||||
| ) | ||||
| ) | ||||
|
|
||||
| ;; CHECK: (module | ||||
| ;; CHECK-NEXT: (type $0 (func)) | ||||
| ;; CHECK-NEXT: (@metadata.code.inline "\12") | ||||
| ;; CHECK-NEXT: (func $func-annotation | ||||
| ;; CHECK-NEXT: (drop | ||||
| ;; CHECK-NEXT: (i32.const 0) | ||||
| ;; CHECK-NEXT: ) | ||||
| ;; CHECK-NEXT: ) | ||||
| ;; CHECK-NEXT: ) | ||||
|
|
||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this expression offset ever end up being 0 as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.