Make SLH lowering the last pass before Stack Allocation #794
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 byassemble_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.