forked from M-Labs/artiq
1
0
Fork 0

transforms.interleaver: don't fail on delay-free loops/conditionals.

This commit is contained in:
whitequark 2015-12-16 19:25:49 +08:00
parent 69cdeaf706
commit 2570932264
1 changed files with 7 additions and 1 deletions

View File

@ -110,8 +110,14 @@ class Interleaver:
assert False
source_terminator = source_block.terminator()
if isinstance(source_terminator, (ir.Parallel, ir.Branch)):
if isinstance(source_terminator, ir.Parallel):
source_terminator.replace_with(ir.Branch(source_terminator.target()))
elif isinstance(source_terminator, ir.Branch):
pass
elif isinstance(source_terminator, ir.BranchIf):
# Skip a delay-free loop/conditional
source_block = postdom_tree.immediate_dominator(source_block)
assert (source_block is not None)
elif isinstance(source_terminator, ir.Return):
break
elif isinstance(source_terminator, ir.Delay):