From 2543daa5cfbb9784ce2d1d4b9cbef74847273f7e Mon Sep 17 00:00:00 2001 From: whitequark Date: Thu, 19 Nov 2015 23:24:46 +0800 Subject: [PATCH] transforms.artiq_ir_generator: don't emit delay instruction for zero delay. Call nodes with iodelay=Const(0) can be generated outside of `with parallel:`, where Interleaver won't and LLVMIRGenerator can't lower them. --- artiq/compiler/transforms/artiq_ir_generator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/artiq/compiler/transforms/artiq_ir_generator.py b/artiq/compiler/transforms/artiq_ir_generator.py index 4ae04a366..9210be8b8 100644 --- a/artiq/compiler/transforms/artiq_ir_generator.py +++ b/artiq/compiler/transforms/artiq_ir_generator.py @@ -8,7 +8,7 @@ semantics explicitly. from collections import OrderedDict, defaultdict from pythonparser import algorithm, diagnostic, ast -from .. import types, builtins, asttyped, ir +from .. import types, builtins, asttyped, ir, iodelay def _readable_name(insn): if isinstance(insn, ir.Constant): @@ -1619,7 +1619,7 @@ class ARTIQIRGenerator(algorithm.Visitor): attr_node = node.func self.method_map[(attr_node.value.type, attr_node.attr)].append(insn) - if node.iodelay is not None: + if node.iodelay is not None and not iodelay.is_const(node.iodelay, 0): after_delay = self.add_block() self.append(ir.Delay(node.iodelay, {var_name: self.current_args[var_name]