[pull] master from phate:master#530
Merged
pull[bot] merged 2 commits intoEECS-NTNU:masterfrom Oct 29, 2025
Merged
Conversation
Replaces Common Node Elimination pass with a slightly different approach. Each congruence set has a "leader" output. Once an output has become a leader it will never become a follower. When marking simple nodes, we just as before look at the leftmost input and compare ourselves to all other simple nodes whose leftmost input is congruent with the origin. If no congruent leader is found, the node becomes its own leader. (more precisely: all its outputs are their own leader). A leader will always come earlier in the top down traversal order than all its followers. When marking thetas we speculatively use the origins of loop variable inputs to partition loop variables, and mark the theta subregion. Once the subregion has been marked, it might turn out that loop variable results were not supposed to be congruent after all. In which case the loop variables are further partitioned, and the subregion is marked again. A fun trick here is that the second time a node is visited, it already knows that it found a leader last time, so it quickly checks if it is still congruent with its old leader. If it is, then it does not need to look at any other nodes. Only if some partitioning has happened since last time to cause the node to no longer be congruent with its old leader, will it start looking for other nodes that it may be congruent with. Runtime comparison in shown in the below plot: <img width="873" height="722" alt="image" src="https://github.com/user-attachments/assets/e37797ae-de8b-4dfb-bed3-6e30496b9df8" /> In both cases we do all tricks in RegionAwareModRef, and then time the CNE afterwards. The axis show billions on nanoseconds, i.e., seconds. The slowest file thus goes from ~400 seconds to 12 seconds. I do want to look into what makes xdisp.c take 12 seconds, btw.. I also want to see what happens to the graphs that took 12 000 seconds with the old CNE.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )