forked from M-Labs/artiq
1
0
Fork 0

transforms.llvm_ir_generator: accept delay instructions.

The delay instruction is just like a branch (discontinuity
in instruction flow), but it also carries metadata: how long
did the execution of its basic block take. This metadata only
matters during inlining and interleaving, so we treat it here
as a mere branch.
This commit is contained in:
whitequark 2015-11-19 23:55:52 +08:00
parent 9639a831bc
commit 025bfbe746
1 changed files with 2 additions and 0 deletions

View File

@ -1068,6 +1068,8 @@ class LLVMIRGenerator:
def process_Branch(self, insn): def process_Branch(self, insn):
return self.llbuilder.branch(self.map(insn.target())) return self.llbuilder.branch(self.map(insn.target()))
process_Delay = process_Branch
def process_BranchIf(self, insn): def process_BranchIf(self, insn):
return self.llbuilder.cbranch(self.map(insn.condition()), return self.llbuilder.cbranch(self.map(insn.condition()),
self.map(insn.if_true()), self.map(insn.if_false())) self.map(insn.if_true()), self.map(insn.if_false()))