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

C#: Adopt shared SSA data-flow integration #16936

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hvitved
Copy link
Contributor

@hvitved hvitved commented Jul 9, 2024

This PR adopts the newly introduced shared SSA data-flow integration layer. A side-effect is that we get phi-input barrier guards for free, which had not previously been ported to C#.

@github-actions github-actions bot added the C# label Jul 9, 2024
@@ -1118,3 +1055,64 @@
result = this.getSourceVariable().getEnclosingCallable()
}
}

private module DataFlowIntegrationInput implements Impl::DataFlowIntegrationInputSig {
private import csharp as Cs

Check warning

Code scanning / CodeQL

Names only differing by case Warning

Cs is only different by casing from CS that is used elsewhere for modules.
shared/ssa/codeql/ssa/Ssa.qll Fixed Show fixed Hide fixed
shared/ssa/codeql/ssa/Ssa.qll Fixed Show fixed Hide fixed
shared/ssa/codeql/ssa/Ssa.qll Fixed Show fixed Hide fixed
@hvitved hvitved force-pushed the csharp/ssa-integration branch 2 times, most recently from 2b175c6 to df69c4e Compare July 11, 2024 09:46
@hvitved hvitved force-pushed the csharp/ssa-integration branch 2 times, most recently from 5b70129 to 86f7735 Compare July 11, 2024 19:38

private newtype TNode =
TParamNode(DfInput::Parameter p) {
exists(WriteDefinition def | DfInput::ssaDefInitializesParam(def, p))

Check warning

Code scanning / CodeQL

Omittable 'exists' variable Warning

This exists variable can be omitted by using a don't-care expression
in this argument
.
@hvitved hvitved added the no-change-note-required This PR does not need a change note label Jul 12, 2024
@hvitved hvitved marked this pull request as ready for review July 12, 2024 12:42
@hvitved hvitved requested a review from a team as a code owner July 12, 2024 12:42
Comment on lines 182 to 184
exists(Guard g, Expr e, AbstractValue v |
guardChecks(g, e, v) and
g.controlsNode(result.getControlFlowNode(), e, v)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this second disjunct not redundant now? Does it cover more than ssa variable reads?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question: Yes, it covers more than SSA variable reads (it uses GVN, which--although it is unsound in general--is likely to produce valid guards).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C# no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants