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

compiler: beam_ssa_ss: Enforce cutoff for list literals #8162

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

frej
Copy link
Contributor

@frej frej commented Feb 20, 2024

The alias analysis pass tracks the structure and aliasing status of values given as arguments and returned from functions. The information is kept in the graph provided by the beam_ssa_ss module and is built when the alias analysis processes instructions constructing terms. When a literal is given as an argument to a function, the graph is extended to have the same structure as if the literal was constructed programmatically.

To handle self-recursive functions which, for example builds a list, there is a cutoff which limits the depth to which the graph is constructed. This allows a fixpoint to be reached without implementing a solver for recurrence equations about the structure of the arguments, but also limits the size of the graph.

This patch corrects an omission in the beam_ssa_ss:merge_in_arg/4 function where the cutoff was not enforced for list literals.

Closes #8140

The alias analysis pass tracks the structure and aliasing status of
values given as arguments and returned from functions. The information
is kept in the graph provided by the beam_ssa_ss module and is built
when the alias analysis processes instructions constructing
terms. When a literal is given as an argument to a function, the graph
is extended to have the same structure as if the literal was
constructed programmatically.

To handle self-recursive functions which, for example builds a list,
there is a cutoff which limits the depth to which the graph is
constructed. This allows a fixpoint to be reached without implementing
a solver for recurrence equations about the structure of the
arguments, but also limits the size of the graph.

This patch corrects an omission in the beam_ssa_ss:merge_in_arg/4
function where the cutoff was not enforced for list literals.

Closes erlang#8140
Copy link
Contributor

github-actions bot commented Feb 20, 2024

CT Test Results

    2 files    324 suites   9m 44s ⏱️
  806 tests   804 ✅ 2 💤 0 ❌
5 361 runs  5 359 ✅ 2 💤 0 ❌

Results for commit 7e5f7b2.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@bjorng bjorng self-assigned this Feb 20, 2024
@bjorng bjorng added team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI labels Feb 20, 2024
@bjorng bjorng merged commit 4e5e268 into erlang:master Feb 22, 2024
17 checks passed
@frej frej deleted the frej/fix-slowdown-gh8140 branch February 22, 2024 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

27.0-rc1 compiler takes ~8x longer on single large module
2 participants