Skip to content

Commit

Permalink
Merge pull request #21467 from JuliaLang/yyc/codegen/cfunction
Browse files Browse the repository at this point in the history
Try to loosen cfunction optimization type check
  • Loading branch information
yuyichao committed May 27, 2017
2 parents 85907b0 + 3660535 commit 3e3f966
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions src/ccall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1787,18 +1787,26 @@ static jl_cgval_t emit_ccall(jl_value_t **args, size_t nargs, jl_codectx_t *ctx)
jl_value_t *frt = expr_type(args[6], ctx);
if (f && (jl_is_type_type((jl_value_t*)frt) && !jl_has_free_typevars(jl_tparam0(frt)))) {
fargt = static_eval(args[8], ctx, true, true);
if (fargt) {
if (jl_is_tuple(fargt)) {
// TODO: maybe deprecation warning, better checking
fargt = (jl_value_t*)jl_apply_tuple_type_v((jl_value_t**)jl_data_ptr(fargt), jl_nfields(fargt));
}
}
else {
if (!fargt) {
fargt = expr_type(args[8], ctx);
if (jl_is_type_type((jl_value_t*)fargt))
if (jl_is_type_type((jl_value_t*)fargt)) {
fargt = jl_tparam0(fargt);
if (jl_has_free_typevars(fargt) || !jl_is_tuple_type(fargt)) {
fargt = nullptr;
}
}
else {
fargt = nullptr;
}
}
else if (jl_is_tuple(fargt)) {
// TODO: maybe deprecation warning, better checking
fargt = (jl_value_t*)jl_apply_tuple_type_v((jl_value_t**)jl_data_ptr(fargt), jl_nfields(fargt));
}
if (jl_is_tuple_type(fargt) && jl_is_leaf_type(fargt)) {
else if (!jl_is_tuple_type(fargt)) {
fargt = nullptr;
}
if (fargt) {
frt = jl_tparam0(frt);
Value *llvmf = NULL;
JL_TRY {
Expand Down

2 comments on commit 3e3f966

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @jrevels

Please sign in to comment.