Comments (4)
What optimization level are you compiling on? If you're compiling with all optimizations off, Wasynth has to generate a lot of locals.
I believe there are plans to introduce unlimited locals eventually but enabling optimizations should fix this in the majority of cases.
from wasynth.
Ah, great point. Slapping an -O3 on there fixed the issue with the example program.
Out of curiosity, would the unlimited locals be powered by just using a table of registers or something like that, or would more complex algorithms be needed?
from wasynth.
I've been experimenting for some time but reached no conclusive solution. I am currently torn between two options:
-
A simple variable hoisting algorithm for allowing locals to be defined at their highest common block.
-
Refactoring the AST to have SSA properties and forget about the concept of a Wasm "local" altogether.
The first would likely solve a lot of the annoying cases (and generate better JIT code). It would fail if there are too many variables scoped to the same block.
The second would require some extra work on my part, but would also allow us to use industry standard solutions. Applying register graph coloring on top of this would allow us an unlimited amount of locals everywhere (with spilling to a table).
from wasynth.
This was band aid fixed in d33e4a6. A proper and efficient solution is planned in the future for the newer version of the tool.
from wasynth.
Related Issues (18)
- LuaJIT pointer operations may have odd behavior
- How to install? HOT 2
- Too much noise from `write_constant`
- Lacking `BrTable` optimization
- Non-emitted function usage from rust
- (Luau) `br_table.wast.lua` test fails due to recursion depth limit HOT 2
- (Luau-only) Many 32 bit tests fail due to 32 bit numbers using 64 bit APIs HOT 2
- Tests with `assert_trap` not generated for `start` HOT 4
- `loop.wast` infinite loop (`luau_translate` only) HOT 1
- LuaJIT `clz`, `ctz`, and `popcnt` are bad
- Make the output formatted HOT 1
- Add `BrTable` optimization heuristic
- Type LuaJIT code as much as possible
- Is there an example of this HOT 2
- WASM memory.copy instruction unimplemented HOT 2
- Undefined behavior regarding bit32 truncation causes differences amongst x86 and other platforms
- tiny bug: wasm2luau says it is wasm2luajit
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wasynth.