Skip to content
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

Implement liveness analysis #229

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kulcsaradam
Copy link
Contributor

@kulcsaradam kulcsaradam commented Feb 22, 2024

With this patch I aim to optimize Walrus stack useage. This patch does not run without errors yet. Currently, there is a variable pushed down the stack for each local variable.

My idea is to analyse the Bytecode and get the maximum amount of variables the code needs at one point and only push down the stack that given number of variables.

The patch is still in draft, I am just curious about things I might have missed or done better! There are definitly parts that can be optimized, which I will try to once I get the patch running properly.

src/interpreter/ByteCode.h Outdated Show resolved Hide resolved
src/parser/WASMParser.cpp Outdated Show resolved Hide resolved
src/parser/WASMParser.cpp Outdated Show resolved Hide resolved
src/parser/WASMParser.cpp Outdated Show resolved Hide resolved
src/parser/WASMParser.cpp Show resolved Hide resolved
@kulcsaradam kulcsaradam force-pushed the live_analysis branch 2 times, most recently from bfdbb4c to 4bb4a46 Compare March 22, 2024 10:20
@kulcsaradam kulcsaradam force-pushed the live_analysis branch 2 times, most recently from 9d6a783 to 2b9957b Compare April 8, 2024 10:41
@kulcsaradam kulcsaradam force-pushed the live_analysis branch 5 times, most recently from e0b6926 to 0a169a2 Compare April 24, 2024 07:57
@kulcsaradam kulcsaradam force-pushed the live_analysis branch 3 times, most recently from c062e79 to 0bd6931 Compare May 9, 2024 13:19
@kulcsaradam kulcsaradam force-pushed the live_analysis branch 3 times, most recently from 903818c to 8e94ba5 Compare June 18, 2024 13:13
@kulcsaradam kulcsaradam force-pushed the live_analysis branch 4 times, most recently from 8eb6770 to b7d1651 Compare June 28, 2024 17:31
@kulcsaradam kulcsaradam force-pushed the live_analysis branch 2 times, most recently from 1fae2e9 to 3033fb2 Compare July 12, 2024 13:11
@kulcsaradam kulcsaradam force-pushed the live_analysis branch 4 times, most recently from 573c03b to 7928cd9 Compare July 22, 2024 11:32
@kulcsaradam kulcsaradam marked this pull request as ready for review July 22, 2024 11:32
@kulcsaradam kulcsaradam force-pushed the live_analysis branch 3 times, most recently from c1b4afd to f99de50 Compare July 23, 2024 07:21
@kulcsaradam kulcsaradam changed the title [WIP] Implement live variable analysis Implement live variable analysis Jul 23, 2024
@kulcsaradam kulcsaradam force-pushed the live_analysis branch 4 times, most recently from 07d8e4f to 889b81a Compare August 7, 2024 12:24
@kulcsaradam kulcsaradam force-pushed the live_analysis branch 4 times, most recently from e141fa4 to cc50def Compare October 31, 2024 12:54
@kulcsaradam kulcsaradam changed the title Implement live variable analysis Implement liveness analysis Oct 31, 2024
Implement live variable analysis for function parameters, variables and constants.
Define the range from start to end offset where a variable is used and allocate space for used variables. Also define which variables need to be cleared before use.
Move constant values to a lower offset on the stack if possibles.

Signed-off-by: Adam Laszlo Kulcsar <kuladam@inf.u-szeged.hu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants