From 8a908a7656c302abf4057a21e27ad4cf1d6925ca Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 29 Mar 2016 15:19:46 +0000 Subject: [PATCH] llvm_ir_generator: do not use 'coldcc' calling convention. First, this calling convention doesn't actually exist in OR1K and trying to use it in Asserts build causes an UNREACHABLE. Second, I tried to introduce it and it does not appear to produce any measurable benefit: not only OR1K has a ton of CSRs but also it is quite hard, if not realistically impossible, to produce the kind of register pressure that would be relieved by sparing a few more CSRs for our exception raising function calls, since temporaries don't have to be preserved before a noreturn call and spilling over ten registers across an exceptional edge is not something that the code we care about would do. Third, it produces measurable drawbacks: it inflates code size of check:* functions by adding spills. Of course, this could be alleviated by making __artiq_raise coldcc as well, but what's the point anyway? --- artiq/compiler/transforms/llvm_ir_generator.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/artiq/compiler/transforms/llvm_ir_generator.py b/artiq/compiler/transforms/llvm_ir_generator.py index 20aa97c3d..474dbd883 100644 --- a/artiq/compiler/transforms/llvm_ir_generator.py +++ b/artiq/compiler/transforms/llvm_ir_generator.py @@ -569,7 +569,6 @@ class LLVMIRGenerator: if func.is_internal: self.llfunction.linkage = 'private' if func.is_cold: - self.llfunction.calling_convention = 'coldcc' self.llfunction.attributes.add('cold') self.llfunction.attributes.add('noinline') @@ -1322,9 +1321,6 @@ class LLVMIRGenerator: if types.is_c_function(functiontyp) and 'nowrite' in functiontyp.flags: llcall.metadata['tbaa'] = self.tbaa_nowrite_call - if insn.is_cold: - llcall.cconv = 'coldcc' - return llresult def process_Invoke(self, insn): @@ -1358,9 +1354,6 @@ class LLVMIRGenerator: if types.is_c_function(functiontyp) and 'nowrite' in functiontyp.flags: llcall.metadata['tbaa'] = self.tbaa_nowrite_call - if insn.is_cold: - llcall.cconv = 'coldcc' - return llcall def _quote(self, value, typ, path):