-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Ssa: Replace phi-read references in VariableCapture with default use-use flow #19154
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot wasn't able to review any files in this pull request.
Files not reviewed (2)
- shared/dataflow/codeql/dataflow/VariableCapture.qll: Language not supported
- shared/ssa/codeql/ssa/Ssa.qll: Language not supported
Tip: Copilot only keeps its highest confidence comments to reduce noise and keep you focused. Learn more
| @@ -1,2 +0,0 @@ | |||
| identityLocalStep | |||
| | main.rs:442:9:442:20 | phi(default_name) | Node steps to itself | | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see corresponding results - a big decrease in data flow inconsistencies - in the DCA run for Rust. ✨
The Swift DCA run shows an analysis slowdown, which is likely noise, but big enough I wouldn't mind a re-run to confirm nothing is wrong there. Other than than the Rust and Swift DCA runs LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The swift analysis slowdowns appear to be mostly on the order of the corresponding stddev values, so I expect it to be noise. But I've started a re-run, so we get another round of numbers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, looks like the Swift slowdown is at least somewhat consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although, it's not that consistent which projects exhibit slowdowns, so the results definitely are noisy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot reproduce any perf issues locally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my experience, the Swift DCA analysis timings are completely useless (wdyt @redsun82 ?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfortunately it's hard to get consistent timings from macOS runners, so I think those can be ignored
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The slowdowns being in different projects is good evidence this is noise to me. 👍
hvitved
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The first commit contains the primary change: The VariableCapture library is updated to use the DataFlowIntegration module instead of direct references to phi-read nodes. The nested SSA instantiation causes a little bit of caching, so I make sure to collapse those stages with parts of VariableCapture that would otherwise be duplicated across several stages. This ensures that we maintain the same number of cached stages (as the nested SSA already introduces a stage), and I think it also ought to be a mostly strict reduction of cross-stage DIL duplication.
The subsequent 2 commits are simple SSA cleanups.