Skip to content

Ssa: Deprecate the unused getALastRead predicate. #18729

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

Merged
merged 3 commits into from
Feb 11, 2025

Conversation

aschackmull
Copy link
Contributor

The SSA predicate getALastRead is entirely unused. Presumably this was needed in the past for proper implementation of out and ref nodes in C#, but this is now handled via pseudo-reads.
This PR deprecates all involved predicates (or deletes in the case of Rust). This means that the ExitBasicBlock in the InputSig is effectively unused, so a second commit deletes that.

@aschackmull aschackmull added the no-change-note-required This PR does not need a change note label Feb 10, 2025
@Copilot Copilot AI review requested due to automatic review settings February 10, 2025 13:40
@aschackmull aschackmull requested review from a team as code owners February 10, 2025 13:40
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 20 out of 20 changed files in this pull request and generated no comments.

Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab. Learn more

@@ -292,7 +290,9 @@

/** Same as `lastRefRedef`, but skips uncertain reads. */
pragma[nomagic]
private predicate lastRefSkipUncertainReadsExt(DefinitionExt def, SsaInput::BasicBlock bb, int i) {
deprecated private predicate lastRefSkipUncertainReadsExt(

Check warning

Code scanning / CodeQL

Missing QLDoc for parameter Warning

The QLDoc has no documentation for bb, or def, or i, but the QLDoc mentions lastRefRedef
Copy link
Contributor

@hvitved hvitved left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one comment.

@@ -958,7 +960,7 @@ private module Cached {
}

cached
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's OK to replace this with pragma[nomagic]; I highly doubt anyone actually calls this.

@@ -407,7 +409,7 @@ private module Cached {
* the end of the CFG scope, without passing through another non-pseudo read.
*/
cached
predicate lastRead(Definition def, VariableReadAccessCfgNode read) {
deprecated predicate lastRead(Definition def, VariableReadAccessCfgNode read) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

@aschackmull aschackmull merged commit e1c810a into github:main Feb 11, 2025
55 checks passed
@aschackmull aschackmull deleted the ssa/deprecate-deadcode branch February 11, 2025 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C# C++ DataFlow Library JS no-change-note-required This PR does not need a change note Ruby Rust Pull requests that update Rust code Swift
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants