-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[wasm] Add optimization flags to bitcode compilation #101538
Conversation
comping from LD optimization flags. This should also fix the recent size regression.
@@ -148,6 +148,8 @@ | |||
|
|||
<WasiClangCompileOptimizationFlag Condition="'$(WasiClangCompileOptimizationFlag)' == ''">$(_WasiClangOptimizationFlagDefault)</WasiClangCompileOptimizationFlag> | |||
<WasmCompileOptimizationFlag>$(WasiClangCompileOptimizationFlag)</WasmCompileOptimizationFlag> | |||
<WasiBitcodeCompileOptimizationFlag Condition="'$(WasiBitcodeCompileOptimizationFlag)' == '' and '$(Configuration)' == 'Release'">-O2</WasiBitcodeCompileOptimizationFlag> |
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.
Do we want a separate property for WASI?
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.
We have other wasi specific flags here too, like WasiClangLinkOptimizationFlag
, so I kept it separate 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.
I think WasiClangLinkOptimizationFlag
is specific thing for WASI. This one is a shared concept from my POV
@@ -44,6 +44,8 @@ | |||
|
|||
- $(EmccLinkOptimizationFlag) - Optimization flag to use for the link step | |||
- $(EmccCompileOptimizationFlag) - Optimization flag to use for compiling native files | |||
- $(WasmBitcodeCompileOptimizationFlag) |
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.
If we end up having a separate WasiBitcodeCompileOptimizationFlag
property for WASI, we should probably state it here.
On the other hand, this file is named common, but it contains basically the browser story properties
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.
The other wasi specific properties are not listed here either. I guess we consider it rapidly moving target?
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.
Lets discuss possible improvements once we fix the regression.
While #101397 fixed the compilation errors, it also introduced new size regression by omitting the optimization flags. These flags were set before by
EmccLinkOptimizationFlag
andWasiClangLinkOptimizationFlag
.