-
Notifications
You must be signed in to change notification settings - Fork 1.7k
SSA: Distinguish between has and controls branch edge. #19567
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
Conversation
/** | ||
* Holds if this guard evaluating to `branch` controls the control-flow | ||
* branch edge from `bb1` to `bb2`. That is, following the edge from | ||
* `bb1` to `bb2` implies that this guard evaluated to `branch`. |
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.
Perhaps add an example to illustrate how this can differ from hasBranchEdge
.
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.
It's the general distinction between direct and indirect control. E.g. if (g) ..
vs. b = g; .. if (b) ..
. I can of course elaborate the qldoc here, but I'm thinking perhaps just leaving it as-is, and then focusing on a more comprehensive elaboration in the upcoming shared Guards library - eventually these two predicates will simply be taken directly from that shared library.
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.
Yes, that is what I was thinking; simply add that example to the QL doc.
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.
done
Dca looks completely fine. This is technically a breaking change for any users of the SSA data flow integration module, so I've added a change note to the SSA qlpack. |
For languages without a guards implication logic,
hasBranchEdge
andcontrolsBranchEdge
is the same thing, but libraries like SSA should distinguish between them. This might theoretically improve barrier guards a bit for Java, but more importantly this prepares us a bit for the introduction of a shared Guards library.