ProgramMemory: avoid duplicated lookups / removed at()#7768
Conversation
|
"impossible" lookups with no exprid will be dealt with in a different PR. |
Sorry, something went wrong.
1cb862f to
7a04197
Compare
August 25, 2025 13:32
|
It appears to not have much impact on performance but it gets rid of the |
Sorry, something went wrong.
|
Should be done but I am seeing slightly less executions when profiling this, which should not be happening since it does not functionally change. So still needs looking into. |
Sorry, something went wrong.
There is indeed a behavior change introduced by this - #7800 surfaced a difference the tests did not catch: --- selfcheck.exp 2025-09-15 07:19:01.345202904 +0200
+++ selfcheck.res 2025-09-15 07:21:07.006911439 +0200
@@ -13626,6 +13626,8 @@
tok2 possible symbolic=(tok->next)
Line 2108
true always 1
+Line 2109
+ . possible symbolic=(tok2)
Line 2112
& {lifetime[Address]=(temp),!0}
Line 2113 |
Sorry, something went wrong.
I missed that |
Sorry, something went wrong.
ea4410b to
1aaf14f
Compare
September 15, 2025 06:15
I consistently added a parameter to the getter (even though they might not be used - can be cleaned up later) and flipped one default. |
Sorry, something went wrong.
|
Sorry, something went wrong.
I need to reproduce my mistake and add a test which causes this but that will probably take quite a while. Also making it more problematic is that I need to do it on an older commit because another change has also caused this change in the ValueFlow. |
Sorry, something went wrong.
|
Sorry, something went wrong.
danmar
left a comment
There was a problem hiding this comment.
I like that we replace hasValue=>at with a getValue. it looks good to me. I hope pfultz2 will review it since he is better on this.
Sorry, something went wrong.
|
Sorry, something went wrong.
|
I feel that my valueflow knowledge is shaky and asked AI to help me out with a review of this PR. Here is AI comments.. please feel free to ignore comments.. 1. Performance regression in non-const
|
Sorry, something went wrong.
|
I am sorry but this really represents how clueless and useless AI actually is - beside it being a complete waste of unimaginable amounts of resources in any possible way. It is incredible how it spins two simple TODOs (which is what it all boils down to) into redundant, bloated drivel. I really baffles me how people think this helpful... Except for the typo this is all intentional and mostly explained. The changes have not really something to do with ValueFlow at all. It is about getting rid of duplicated lookups, the awkward |
Sorry, something went wrong.
well I am not against that any review comments from AI are ignored. I am thinking that this is a way to provide quicker reviews which have been asked for. My intention is that it's a complement not a replacement. I will continue to review manually also but it's slow and I can't dedicate more time. Unfortunately ValueFlow is also an area where I feel I can't make really good reviews. I can miss really important problems when I review. So I don't feel comfortable about approving such PRs on my own.. I don't want to throw complete garbage at people. I looked at the AI comments before I posted and thought they were worth posting. It happens that I remove comments. About (1) that did sound important to me but if you reject it I am sorry for the noise, personally I feel more confident after you explicitly rejected it. About (2) if there is behavior change that would have been a problem so I am glad you say this does not happen. |
Sorry, something went wrong.
|
(1) is just plain wrong. There is no regression. It matches the previous Of the few AI stuff I had to experience almost everything has been like this. It does not know what it is talking about, and distracts by being overly expeditionary and getting distracted by butterflies. It should be neither reviewing PRs not creating them. It is like when I try to do PRs/tickets/reviews which in areas I am not very familiar or knowledgeable of (see performance related stuff in LLVM or internals in IWYU / most of the Cppcheck stuff is probably okay - albeit in parts only borderline). The only difference is that I am not trying to be smart about it and that I might actually learn that I should probably stay away from those things I do not understand and not waste anybodys time whereas AI will just keep spewing its uneducated filth. What a waste this was ... |
Sorry, something went wrong.



all
at()calls were proceeded byhasValue()so we can just directly fetch the value instead.