-
Notifications
You must be signed in to change notification settings - Fork 1.8k
C#: Refactor Structural Comparison for Control Flow Elements. #8038
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#: Refactor Structural Comparison for Control Flow Elements. #8038
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.
Added a couple of comments. This is a low confidence first review.
BTW, what's the benefit of doing the comparison with GVN vs the previous structural comparison?
csharp/ql/lib/semmle/code/csharp/commons/StructuralComparison.qll
Outdated
Show resolved
Hide resolved
csharp/ql/lib/semmle/code/csharp/commons/StructuralComparison.qll
Outdated
Show resolved
Hide resolved
csharp/ql/test/library-tests/structuralcomparison/structuralComparison.ql
Outdated
Show resolved
Hide resolved
Thank you for looking into this! |
395d10f
to
ec91e92
Compare
…een control flow elements and global value numbers.
…ntrol flow predicates, where we want to look for structural equality.
ec91e92
to
23fbfbc
Compare
@hvitved: The DCA run now completed and it looks like there are no overall performance regressions. Some queries themselves might be a bit slower now, but maybe that could be linked to building the cache? There was identified a single "join order badness", but that is not side effect of this change. |
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.
Looks very good to me! I have made some (mostly trivial) suggestions here.
C#: Code review suggestions
In this PR we re-factor the existing implementation of the structural comparison for controls flow elements.
The new approach is based on a global value number approach.
The idea is strongly linked to the global value numbering used in the type unification.
Please note that the implementation is still hidden under the existing interface, but we plan to make a follow up PR where this is removed.