Skip to content

Commit

Permalink
Add disable_omit_fp support for LLVM (#2045)
Browse files Browse the repository at this point in the history
  • Loading branch information
monojenkins authored and akoeplinger committed Jan 23, 2020
1 parent 5bee16d commit 81f5310
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/mono/mono/mini/mini-llvm-cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,14 @@ mono_llvm_add_func_attr (LLVMValueRef func, AttrKind kind)
unwrap<Function> (func)->addAttribute (AttributeList::FunctionIndex, convert_attr (kind));
}

void
mono_llvm_add_func_attr_nv (LLVMValueRef func, const char *attr_name, const char *attr_value)
{
AttrBuilder NewAttrs;
NewAttrs.addAttribute (attr_name, attr_value);
unwrap<Function> (func)->addAttributes (AttributeList::FunctionIndex, NewAttrs);
}

void
mono_llvm_add_param_attr (LLVMValueRef param, AttrKind kind)
{
Expand Down
3 changes: 3 additions & 0 deletions src/mono/mono/mini/mini-llvm-cpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ mono_llvm_set_alignment_ret (LLVMValueRef val, int alignment);
void
mono_llvm_add_func_attr (LLVMValueRef func, AttrKind kind);

void
mono_llvm_add_func_attr_nv (LLVMValueRef func, const char *attr_name, const char *attr_value);

void
mono_llvm_add_param_attr (LLVMValueRef param, AttrKind kind);

Expand Down
3 changes: 3 additions & 0 deletions src/mono/mono/mini/mini-llvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -8559,6 +8559,9 @@ emit_method_inner (EmitContext *ctx)

mono_llvm_add_func_attr (method, LLVM_ATTR_UW_TABLE);

if (cfg->disable_omit_fp)
mono_llvm_add_func_attr_nv (method, "no-frame-pointer-elim", "true");

if (cfg->compile_aot) {
if (is_externally_callable (ctx, cfg->method)) {
LLVMSetLinkage (method, LLVMExternalLinkage);
Expand Down

0 comments on commit 81f5310

Please sign in to comment.