jameysharp requested cfallin for a review on PR #7948.
jameysharp requested wasmtime-compiler-reviewers for a review on PR #7948.
jameysharp opened PR #7948 from jameysharp:domtree
to bytecodealliance:main
:
The egraph work introduced a helper for walking over the dominator tree in pre-order, but it turns out that helper already existed in the
dominator_tree
module itself, and the older version also supports constant-time dominance checks using the same trick that @cfallin suggested in #7891. So let's just use that version.cc: @elliottt @lpereira
cfallin submitted PR review:
Woah,nice find! I had no idea we already had this (which I guess is why we wrote it again).
While I hesitate to violate the law that "any sufficiently advanced compiler contains three domtree implementations" (regalloc2 has one too!), I think we can do some spring cleaning here :-)
cfallin submitted PR review:
Woah,nice find! I had no idea we already had this (which I guess is why we wrote it again).
While I hesitate to violate the law that "any sufficiently advanced compiler contains three domtree implementations" (regalloc2 has one too!), I think we can do some spring cleaning here :-)
cfallin created PR review comment:
Can we update the name and comment here to match the type ("a preorder iterator over the domtree" or something similar)?
cfallin submitted PR review:
Woah, nice find! I had no idea we already had this (which I guess is why we wrote it again).
While I hesitate to violate the law that "any sufficiently advanced compiler contains three domtree implementations" (regalloc2 has one too!), I think we can do some spring cleaning here :-)
jameysharp updated PR #7948.
jameysharp submitted PR review.
jameysharp created PR review comment:
When I looked again today at these modules to decide what to rename the fields to and what documentation to write, I discovered that the original
DominatorTree
isn't actually needed anywhere once we have aDominatorTreePreorder
available. There was onedebug_assert!
using the original tree for dominance queries, but we can do those in O(1) time against the preorder instead. So I've renameddomtree_children
just todomtree
, replacing the otherdomtree
field entirely.
cfallin submitted PR review.
cfallin created PR review comment:
Nice!
lpereira commented on PR #7948:
LGTM!
jameysharp merged PR #7948.
Last updated: Dec 23 2024 at 12:05 UTC