Zero alloc: propagate assume on partial applications #2543
Closed
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.
This PR proposes to propagate "assume" annotation from a partial application to application to extra arguments.
This came up in a discussion of #2165 (see example below).
It came up again recently in #2459 where a new test has different analysis results depending on compiler configuration with or without stack allocation, even though the generated code is the same and there is no stack allocation.
The fix is easy but I am not sure it's the right thing to do.
In the examples below, the generated code for functions
g0-g3
is the same.The check pass on
g0
but fails ong1
below, as expected.Should the check fail or pass on
g2
andg3
?This PR updates the tests for
g2
andg3
to pass and removes a special case for heap allocation in a test recenlty added by #2459.