From a0a2650fca8dc9840ef0ab9d1d64c58b06e008dd Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 26 Dec 2017 16:24:57 +0000 Subject: [PATCH] compiler: do not use invoke for calls to nounwind ffi functions. Otherwise, declarations such as: @syscall(flags={"nounwind", "nowrite"}) def foo(...): trip an LLVM assert because the invoke instruction and the !tbaa metadata are no longer compatible since LLVM 4.0. --- artiq/compiler/transforms/artiq_ir_generator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/artiq/compiler/transforms/artiq_ir_generator.py b/artiq/compiler/transforms/artiq_ir_generator.py index a1bc76956..f2e9d5bd3 100644 --- a/artiq/compiler/transforms/artiq_ir_generator.py +++ b/artiq/compiler/transforms/artiq_ir_generator.py @@ -1812,7 +1812,8 @@ class ARTIQIRGenerator(algorithm.Visitor): assert None not in args - if self.unwind_target is None: + if self.unwind_target is None or \ + types.is_function(callee.type) and "nounwind" in callee.type.flags: insn = self.append(ir.Call(func, args, arg_exprs)) else: after_invoke = self.add_block("invoke")