Refactor graph traversal in GlobalEffects#8593
Open
stevenfontanella wants to merge 3 commits intomainfrom
Open
Refactor graph traversal in GlobalEffects#8593stevenfontanella wants to merge 3 commits intomainfrom
stevenfontanella wants to merge 3 commits intomainfrom
Conversation
113c475 to
a0ec0cf
Compare
a0ec0cf to
e7e6e33
Compare
Member
|
Interesting idea about using the SCCs to further optimize the propagation. We already have a SCC utility that would hopefully make this fairly easy to experiment with. And if we need to detect cycles to add an extra trapping effect, then we could just look for self-edges and nontrivial SCCs. But let's not do that here! |
tlively
reviewed
Apr 11, 2026
Member
tlively
left a comment
There was a problem hiding this comment.
Nice! Glad to see that this approach speeds things up.
tlively
approved these changes
Apr 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor GlobalEffects to not compute the transitive call graph explicitly but instead aggregate effects as we go. This improves the runtime of the pass by 4.3% on calcworker (1.21792 s -> 1.16586 s averaged over 20 compilations). It also helps prepare the code for future changes to support effects for indirect calls.
Another potential future improvement here is to use SCC, which would let us stop processing children early in cases where there are no effects to update. Currently we can't do this because we add trap effects to potentially-recursive call loops, so even if no effects were updated, we need to keep going to find potential cycles.