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

Make SLH lowering the last pass before Stack Allocation #794

Merged
merged 1 commit into from
May 13, 2024

Conversation

sarranz
Copy link
Collaborator

@sarranz sarranz commented May 11, 2024

We need to put SLH lowering as late as possible so that the SCT checker can run as late as possible. In particular this means that it goes after propagate inline, which is important for the DOIT checker #736.
This introduces an annoyance, which is that propagate inline might introduce double negations (e.g. if we have inline bool b = !x). These get solved later by assemble_cond I believe. But the SLH pass does not understand them.
I now use constant propagation in the SLH pass (before we kept the last condition we saw in the environment, now we keep the simplified version of it, and then before comparing we simplify the expression in the update_msf).

I believe this doesn't mean we accept more programs, since constant propagation was running on all expressions anyways. Furthermore I only use the propagation to checker whether two expressions evaluate to the same value, I don't change the code.
The SCT checker didn't change.

bgregoir
bgregoir previously approved these changes May 13, 2024
compiler/src/glob_options.ml Outdated Show resolved Hide resolved
@bgregoir bgregoir merged commit e39717d into jasmin-lang:main May 13, 2024
@sarranz sarranz deleted the delay-slh-lowering branch November 15, 2024 19:00
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