-
Notifications
You must be signed in to change notification settings - Fork 820
GlobalStructInference: Run the safe parts in open world #8020
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
base: main
Are you sure you want to change the base?
Conversation
test/lit/passes/gsi-nontype.wast
Outdated
|
|
||
| ;; Non-type-based optimizations in --gsi | ||
| ;; RUN: foreach %s %t wasm-opt --gsi -all -S -o - | filecheck %s | ||
| ;; RUN: foreach %s %t wasm-opt --gsi --closed-world -all -S -o - | filecheck %s --check-prefix=CLOSD |
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.
Is all the output the same? If so, we don't need a new prefix here.
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.
Oh right, thanks. Removed.
| } | ||
| addIfNoDWARFIssues("gsi"); | ||
| } | ||
| addIfNoDWARFIssues("gsi"); |
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.
dbc: Will this also be enabled in -Os (from the options.optimizeLevel >= 2) condition on line 749 it seems this is for -O2 and -O3)?
At least the part of gsi that will preform this global.get + struct.get optimization will lead to lower code size and would therefore make sense to run in -Os.
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.
Yes, this runs in -Os. -Os is equivalent to -O2 plus setting the shrink level to 1,
binaryen/src/tools/optimization-options.h
Line 46 in f23ae35
| static constexpr const int OS_OPTIMIZE_LEVEL = 2; |
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.
Great 👍
We cannot infer a struct is only created in a global, but we can see
global.gets and optimize them, at least, in a non-type-based way,
even in open world.
Fixes #8016