Skip to content

Commit

Permalink
llvm_ir_generator: do not use 'coldcc' calling convention.
Browse files Browse the repository at this point in the history
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?
whitequark committed Mar 29, 2016
1 parent 5860220 commit 8a908a7
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions artiq/compiler/transforms/llvm_ir_generator.py
Original file line number Diff line number Diff line change
@@ -569,7 +569,6 @@ def process_function(self, func):
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 @@ def process_Call(self, insn):
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 @@ def process_Invoke(self, insn):
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):

0 comments on commit 8a908a7

Please sign in to comment.