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

Const Prop SSA analysis performance bottleneck #242

Open
ailrst opened this issue Sep 16, 2024 · 1 comment
Open

Const Prop SSA analysis performance bottleneck #242

ailrst opened this issue Sep 16, 2024 · 1 comment

Comments

@ailrst
Copy link
Contributor

ailrst commented Sep 16, 2024

Doing tests on random programs of different sizes generated by csmith, and the timeout point is consistently the constant prop solver with SSA, this should definitely not be the bottleneck so something is wrong.
The flamegraph profile seems to show most of the work still in map join so I'm guessing its due to there being one variable per assignment in the state domain now. We could make it so only initial definitions and phi nodes increase the size of the variable mapping, ie. previous state mapping on the same variable with different index can be deleted when they are redefined (assuming they are never referenced which is the case immediately after the ssa transform but may not neccessarily be maintained).

cpssa

cpssaloglog

(graph ran out of colours but the top line is ConstantPropagationSolverWithSSA)

image

full flamegraph

@l-kent
Copy link
Contributor

l-kent commented Sep 16, 2024

The SSA constant propagation is exponential with branching (unlike the regular constant propagation), and pretty inefficient because it really doesn't need to store the state per CFGPosition given that each assignment is to a unique variable. Those combined are probably why it's the bottleneck unless there's a bug that causes it to get stuck for some cases or something.

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

No branches or pull requests

2 participants