Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/artiq
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4def5617106d
Choose a base ref
...
head repository: m-labs/artiq
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2570932264e4
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Dec 16, 2015

  1. Copy the full SHA
    69cdeaf View commit details
  2. Copy the full SHA
    2570932 View commit details
Showing with 15 additions and 5 deletions.
  1. +15 −5 artiq/compiler/transforms/interleaver.py
20 changes: 15 additions & 5 deletions artiq/compiler/transforms/interleaver.py
Original file line number Diff line number Diff line change
@@ -104,15 +104,23 @@ def time_after_block(pair):
target_terminator = target_block.terminator()
if isinstance(target_terminator, ir.Parallel):
target_terminator.replace_with(ir.Branch(source_block))
else:
assert isinstance(target_terminator, (ir.Delay, ir.Branch))
elif isinstance(target_terminator, (ir.Delay, ir.Branch)):
target_terminator.set_target(source_block)
else:
assert False

source_terminator = source_block.terminator()

if not isinstance(source_terminator, ir.Delay):
if isinstance(source_terminator, ir.Parallel):
source_terminator.replace_with(ir.Branch(source_terminator.target()))
else:
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):
old_decomp = source_terminator.decomposition()
if is_pure_delay(old_decomp):
if target_time_delta > 0:
@@ -144,6 +152,8 @@ def time_after_block(pair):
source_terminator.interval = iodelay.Const(target_time_delta)
else:
source_terminator.replace_with(ir.Branch(source_terminator.target()))
else:
assert False

target_block = source_block
target_time = new_target_time