-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
transforms.interleaver: add boilerplate.
whitequark
committed
Nov 17, 2015
1 parent
de9d7eb
commit 48a2bb1
Showing
3 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
""" | ||
:class:`Interleaver` reorders requests to the RTIO core so that | ||
the timestamp would always monotonically nondecrease. | ||
""" | ||
|
||
from .. import ir | ||
from ..analyses import domination | ||
|
||
class Interleaver: | ||
def __init__(self, engine): | ||
self.engine = engine | ||
|
||
def process(self, functions): | ||
for func in functions: | ||
self.process_function(func) | ||
|
||
def process_function(self, func): | ||
domtree = domination.PostDominatorTree(func) | ||
print(func) | ||
for block in func.basic_blocks: | ||
idom = domtree.immediate_dominator(block) | ||
print(block.name, "->", idom.name if idom else "<exit>") |