Skip to content

Commit

Permalink
feat: finish dominance
Browse files Browse the repository at this point in the history
  • Loading branch information
FlickerSoul committed May 18, 2024
1 parent e5436be commit 2f471ad
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pages/posts/2024/fantastic-cfgs/part2/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ This post uses [Bril](https://capra.cs.cornell.edu/bril/intro.html),
an compiler IR for learning. Part of the code used for this post was modified
from Bril.

## Natural Loops
## Dominance

As we have discussed in the [previous post](/posts/2024/fantastic-cfgs/part1/),
cycles can be formed due to the loops in the program.
Expand Down Expand Up @@ -92,6 +92,11 @@ Before defining what a natural loop is, we need to identify a couple relations:

<DominanceExamples />

We can use the same data flow framework to find the dominance easily: when
visiting a basic block on CFG, add the identity of the block to combined
information flowed from its predecessors, and pass all to its predecessors; when
combining information, take the intersection of the information from all paths.

## Optimizations

### Loop-Invariant Code Motion
Expand Down

0 comments on commit 2f471ad

Please sign in to comment.