Skip to content

Commit

Permalink
[mono][llvm] Enable the cold calling conv on osx/linux. (#83519)
Browse files Browse the repository at this point in the history
  • Loading branch information
vargaz authored Apr 27, 2023
1 parent 318186b commit a2acc6c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/mono/mono/mini/mini-llvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1220,22 +1220,28 @@ simd_op_to_llvm_type (int opcode)
#endif
}

#if defined(TARGET_OSX) || defined(TARGET_LINUX)
#define COLD_CCONV_SUPPORTED 1
#elif !defined(TARGET_WATCHOS) && !defined(TARGET_ARM) && !defined(TARGET_ARM64)
#define COLD_CCONV_SUPPORTED 1
#endif

static void
set_cold_cconv (LLVMValueRef func)
{
/*
* xcode10 (watchOS) and ARM/ARM64 doesn't seem to support preserveall, it fails with:
* fatal error: error in backend: Unsupported calling convention
*/
#if !defined(TARGET_WATCHOS) && !defined(TARGET_ARM) && !defined(TARGET_ARM64)
#ifdef COLD_CCONV_SUPPORTED
LLVMSetFunctionCallConv (func, LLVMColdCallConv);
#endif
}

static void
set_call_cold_cconv (LLVMValueRef func)
{
#if !defined(TARGET_WATCHOS) && !defined(TARGET_ARM) && !defined(TARGET_ARM64)
#ifdef COLD_CCONV_SUPPORTED
LLVMSetInstructionCallConv (func, LLVMColdCallConv);
#endif
}
Expand Down

0 comments on commit a2acc6c

Please sign in to comment.