From f92ce291efa18be5d3788addc1d237a041bd8c1e Mon Sep 17 00:00:00 2001 From: whitequark Date: Sun, 10 Jan 2016 15:54:46 +0000 Subject: [PATCH] transforms.llvm_ir_generator: call devirtualized functions directly. --- artiq/compiler/transforms/llvm_ir_generator.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/artiq/compiler/transforms/llvm_ir_generator.py b/artiq/compiler/transforms/llvm_ir_generator.py index 4563509ca..45632bf6a 100644 --- a/artiq/compiler/transforms/llvm_ir_generator.py +++ b/artiq/compiler/transforms/llvm_ir_generator.py @@ -925,10 +925,13 @@ class LLVMIRGenerator: return llvalue def _prepare_closure_call(self, insn): - llclosure = self.map(insn.target_function()) llargs = [self.map(arg) for arg in insn.arguments()] + llclosure = self.map(insn.target_function()) llenv = self.llbuilder.extract_value(llclosure, 0) - llfun = self.llbuilder.extract_value(llclosure, 1) + if insn.static_target_function is None: + llfun = self.llbuilder.extract_value(llclosure, 1) + else: + llfun = self.map(insn.static_target_function) return llfun, [llenv] + list(llargs) def _prepare_ffi_call(self, insn):