mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-14 07:21:30 +00:00
Utilize Binaryen's -O4
When specifying -O3 or -Oz, asc now automatically increases the optimize level to 4, then including costly non-LLVM optimizations for blocky code, in turn achieving similar results as an LLVM-based generator.
This commit is contained in:
@ -491,6 +491,10 @@ exports.main = function main(argv, options, callback) {
|
||||
shrinkLevel = 2;
|
||||
}
|
||||
|
||||
// Implicitly run costly non-LLVM optimizations on -O3 or -Oz
|
||||
// see: https://github.com/WebAssembly/binaryen/pull/1596
|
||||
if (optimizeLevel >= 3 || shrinkLevel >= 2) optimizeLevel = 4;
|
||||
|
||||
module.setOptimizeLevel(optimizeLevel > 0 ? optimizeLevel : 0);
|
||||
module.setShrinkLevel(shrinkLevel);
|
||||
module.setDebugInfo(debugInfo);
|
||||
|
Reference in New Issue
Block a user