-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Go: Improve bad join order in guardingCall #18831
base: main
Are you sure you want to change the base?
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.
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
Tip: Copilot code review supports C#, Go, Java, JavaScript, Markdown, Python, Ruby and TypeScript, with more languages coming soon. Learn more
This seems very brittle and even though the result works as intended, I don't see much reason for that - I'm actually somewhat confused about why this even works - it seems that the added pragma ought to prohibit the good order. It would seem safer to use |
I'm also confused about why that binding hint doesn't actually cue it to go the other way around, via the output/input first and only then getting to a call node. I note that the old order shows Property.checkOn magic'd in from the use-site, whereas the new one doesn't. I don't know off-hand if the magic is a good thing or not here. |
My intention was to make it evaluate |
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.
I made a quick check to convince myself I wasn't going nuts, and surrounding any of f
and c
with bind-in or bind-out annotations has no effect. I would expect some to serve as a cue to go inp -> c -> f or f -> c -> inp, but apparently not. Since the annotations don't seem to be doing anything, I suggest simply dropping them.
@@ -385,9 +385,9 @@ module BarrierGuard<guardChecksSig/3 guardChecks> { | |||
Node nd, Node resNode | |||
) { | |||
guardingFunction(g, f, inp, outp, p) and | |||
c = f.getACall() and | |||
c = pragma[only_bind_into](f).getACall() and |
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.
c = pragma[only_bind_into](f).getACall() and | |
c = f.getACall() and |
New RA looks good:
DCA looks good. Thought: |
Old code:
Old join order (note that
FunctionOutput.getExitNode
comes from ``outp.getNode`, which is just a wrapper for it):It is finding the exit node corresponding to
inp
of all callsc
, and only afterwards restrictingc
to be a call tof
. This doesn't seem to be taking a long time, but it seems worth fixing the join order in case it takes a long time on some other database.New code:
New join order: