Skip to content

Conversation

@jakobbotsch
Copy link
Member

@jakobbotsch jakobbotsch commented Jan 13, 2024

  • Switch the block weighting logic to be based on the new dominator tree
  • Remove the old DFS
  • Remove the old dominator computation
  • Remove the old DomTreeVisitor and rename NewDomTreeVisitor -> DomTreeVisitor
  • Rename BasicBlock::bbNewPostorderNum -> BasicBlock::bbPostorderNum

Some diffs expected due to the more precise handling of exceptional flow. Some TP improvements expected from removing some unnecessary DFS/dominator computations. More improvements should come with follow-ups to avoid some unnecessary recomputations.

- Remove `BasicBlock::bbIDom`. Move it into `DomTreeNode` instead so
  that multiple dominator trees aren't sharing a field in the basic
  block.
- Introduce `FlowGraphDominatorTree::BuildFromRegularFlow`. It builds a
  dominator tree over the regular flow, ignoring exceptional flow.
  Switch the block weighting logic to be based on this tree.
- Remove the old DFS
- Remove the old dominator computation
- Remove the old `DomTreeVisitor` and rename `NewDomTreeVisitor` ->
  `DomTreeVisitor`
- Rename `BasicBlock::bbNewPostorderNum` -> `BasicBlock::bbPostorderNum`
@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jan 13, 2024
@ghost ghost assigned jakobbotsch Jan 13, 2024
@ghost
Copy link

ghost commented Jan 13, 2024

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Issue Details
  • Remove BasicBlock::bbIDom. Move it into DomTreeNode instead so that multiple dominator trees aren't sharing a field in the basic block.
  • Introduce FlowGraphDominatorTree::BuildFromRegularFlow. It builds a dominator tree over the regular flow, ignoring exceptional flow. Switch the block weighting logic to be based on this tree.
  • Remove the old DFS
  • Remove the old dominator computation
  • Remove the old DomTreeVisitor and rename NewDomTreeVisitor -> DomTreeVisitor
  • Rename BasicBlock::bbNewPostorderNum -> BasicBlock::bbPostorderNum

Minor diffs expected due to differences in treatment of unreachable blocks when computing the new regular flow dominators.

Author: jakobbotsch
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -


if (!dfsTree->Contains(predBlock))
{
DBG_SSA_JITDUMP(" Unreachable node\n");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a preexisting bug. The below loop would read the bbIDom set by the old dominator computation in this case.

@jakobbotsch jakobbotsch marked this pull request as ready for review January 14, 2024 21:09
@jakobbotsch
Copy link
Member Author

cc @dotnet/jit-contrib PTAL @BruceForstall

Diffs. Some minor code diffs, due to the more precise exceptional flow handling. Some larger TP improvements.

@jakobbotsch jakobbotsch merged commit 143a9bf into dotnet:main Jan 17, 2024
@jakobbotsch jakobbotsch deleted the delete-old-dfs-doms branch January 17, 2024 00:04
tmds pushed a commit to tmds/runtime that referenced this pull request Jan 23, 2024
- Switch the block weighting logic to be based on the new dominator tree
- Remove the old DFS
- Remove the old dominator computation
- Remove the old `DomTreeVisitor` and rename `NewDomTreeVisitor` -> `DomTreeVisitor`
- Rename `BasicBlock::bbNewPostorderNum` -> `BasicBlock::bbPostorderNum`
@github-actions github-actions bot locked and limited conversation to collaborators Feb 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants