Last active
January 6, 2026 22:59
-
-
Save navyxliu/c32053f8b7f49df872804cf426d9f2f8 to your computer and use it in GitHub Desktop.
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
| CSE of MLIR is pretty much hash-based global value numbering. For each region, it Depth-First-Search(DFS) the dominator tree using a very efficient implementation. | |
| https://github.com/llvm/llvm-project/blob/main/mlir/lib/Transforms/CSE.cpp#L333-L359 | |
| I learned is that we don't need to push all children to the stack. we can push just one child and increase the iterator! | |
| currentNode->childIterator++. | |
| There are 2 benefits: | |
| 1) worst space complexity is the height of the tree. | |
| 2) this code accesses memory sequentially. | |
| cache locality is the king! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment