-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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++: Fix some FPs in cpp/missing-check-scanf
(second attempt)
#17938
base: main
Are you sure you want to change the base?
C++: Fix some FPs in cpp/missing-check-scanf
(second attempt)
#17938
Conversation
e0f0b0a
to
930efc2
Compare
|
d01d8f1
to
7a802d5
Compare
7a802d5
to
ac2630c
Compare
ac2630c
to
bb85aa2
Compare
cpp/missing-check-scanf
(second attempt)
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.
Comments on the first two commits. There's a few comments to occur in several places. Feel free to only react to one of those if you think nothing needs to be changed.
private class CompareEQValueNumber extends CompareValueNumber { | ||
override CompareEQInstruction cmp; | ||
} | ||
|
||
private class CompareNEValueNumber extends CompareValueNumber { | ||
override CompareNEInstruction cmp; | ||
} | ||
|
||
private class CompareLTValueNumber extends CompareValueNumber { | ||
override CompareLTInstruction cmp; | ||
} | ||
|
||
private class CompareGTValueNumber extends CompareValueNumber { | ||
override CompareGTInstruction cmp; | ||
} | ||
|
||
private class CompareLEValueNumber extends CompareValueNumber { | ||
override CompareLEInstruction cmp; | ||
} | ||
|
||
private class CompareGEValueNumber extends CompareValueNumber { | ||
override CompareGEInstruction cmp; | ||
} |
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.
Are these all possible cases?
* A value number such that at least one of the instructions is an | ||
* insruction that is used in a `SwitchInstruction`'s expression. | ||
*/ | ||
private class ScrutineeValueNumber extends ValueNumber { |
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.
Maybe ControllingValueNumber
?
CompareInstruction cmp, Operand left, Operand right, int k, boolean isLt, AbstractValue value | ||
ValueNumber cmp, Operand left, Operand right, int k, boolean isLt, AbstractValue value |
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.
Why not CompareValueNumber
?
CompareInstruction cmp, Operand left, Operand right, int k, boolean isLt, AbstractValue value | ||
ValueNumber cmp, Operand left, Operand right, int k, boolean isLt, AbstractValue value |
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.
Why not CompareValueNumber
?
CompareInstruction cmp, Operand left, Operand right, int k, boolean isLt, AbstractValue value | ||
ValueNumber cmp, Operand left, Operand right, int k, boolean isLt, AbstractValue value |
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.
Why not CompareValueNumber
?
CompareInstruction cmp, Operand left, Operand right, int k, boolean areEqual, AbstractValue value | ||
ValueNumber cmp, Operand left, Operand right, int k, boolean areEqual, AbstractValue value |
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.
Why not CompareValueNumber
?
CompareInstruction cmp, Operand left, Operand right, int k, boolean areEqual, AbstractValue value | ||
ValueNumber cmp, Operand left, Operand right, int k, boolean areEqual, AbstractValue value |
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.
Why not CompareValueNumber
?
Co-authored-by: Jeroen Ketema <[email protected]>
Co-authored-by: Jeroen Ketema <[email protected]>
Co-authored-by: Jeroen Ketema <[email protected]>
#16009 gave good results, but was unfortunately closed due to performance problems in DCA. Initially, I had concluded that GVN was causing
ensuresEq(test, e, ..., block, ...)
to hold for too many (e, block
) pairs and thus causing a slowdown.After working through some performance problems in Ben's alternative PR #17907 I realized that the performance problem was actually coming from an existing problem in the
unary_simple_comparison_eq
predicate: currently, onmain
, there is a very large QLDoc and some very ad-hoc conjunctions in the second disjunct ofunary_simple_comparison_eq
to reduce the size of the predicate. However, it turns out that this is too doing a very good job.Instead, the second commit is restricting the predicate properly by pruning the set down to only those tests that are used in unary comparisons that we actually care about.
Commits a40c1d5 and db38069 are taken from #16009 which @jketema has already looked at (although I don't blame you for wanting to re-review it if you want to. Let me know if you want me to split up the complex commit again like in #16009). The only new thing is the pruning in 442968c
The commits that were tested at the latest DCA is consistent with the HEAD of this branch. I just force-pushed to clean up tests remove some spurious imports I had when experimenting with stuff.