[wasm] Add optimization flags to bitcode compilation#101538
[wasm] Add optimization flags to bitcode compilation#101538lewing merged 5 commits intodotnet:mainfrom
Conversation
comping from LD optimization flags. This should also fix the recent size regression.
Co-authored-by: Larry Ewing <lewing@microsoft.com>
|
|
||
| <WasiClangCompileOptimizationFlag Condition="'$(WasiClangCompileOptimizationFlag)' == ''">$(_WasiClangOptimizationFlagDefault)</WasiClangCompileOptimizationFlag> | ||
| <WasmCompileOptimizationFlag>$(WasiClangCompileOptimizationFlag)</WasmCompileOptimizationFlag> | ||
| <WasiBitcodeCompileOptimizationFlag Condition="'$(WasiBitcodeCompileOptimizationFlag)' == '' and '$(Configuration)' == 'Release'">-O2</WasiBitcodeCompileOptimizationFlag> |
There was a problem hiding this comment.
Do we want a separate property for WASI?
There was a problem hiding this comment.
We have other wasi specific flags here too, like WasiClangLinkOptimizationFlag, so I kept it separate as well.
There was a problem hiding this comment.
I think WasiClangLinkOptimizationFlag is specific thing for WASI. This one is a shared concept from my POV
|
|
||
| - $(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.
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.
The other wasi specific properties are not listed here either. I guess we consider it rapidly moving target?
lewing
left a comment
There was a problem hiding this comment.
Lets discuss possible improvements once we fix the regression.
* [wasm] Add optimization flag to bitcode compilation comping from LD optimization flags. This should also fix the recent size regression. * Document the new property * Update src/mono/browser/build/BrowserWasmApp.targets Co-authored-by: Larry Ewing <lewing@microsoft.com> * Fix the conditions --------- Co-authored-by: Larry Ewing <lewing@microsoft.com>
* [wasm] Add optimization flag to bitcode compilation comping from LD optimization flags. This should also fix the recent size regression. * Document the new property * Update src/mono/browser/build/BrowserWasmApp.targets Co-authored-by: Larry Ewing <lewing@microsoft.com> * Fix the conditions --------- Co-authored-by: Larry Ewing <lewing@microsoft.com>


While #101397 fixed the compilation errors, it also introduced new size regression by omitting the optimization flags. These flags were set before by
EmccLinkOptimizationFlagandWasiClangLinkOptimizationFlag.