Skip to content

Commit

Permalink
aot_resolve_stack_sizes: relax checks a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
yamt committed Jun 6, 2023
1 parent 788d5a3 commit fb5d602
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions core/iwasm/compilation/aot_emit_aot_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -2498,11 +2498,19 @@ read_stack_usage_file(const char *filename, uint32_t *sizes, uint32 count)
(uint32_t)func_idx, sizes[func_idx]);
}
fclose(fp);
if (found != count || precheck_found != count) {
LOG_ERROR("%" PRIu32 " entires and %" PRIu32
" precheck entries found where %" PRIu32
if (precheck_found != count) {
LOG_ERROR("%" PRIu32 " precheck entries found where %" PRIu32
" entries are expected",
found, precheck_found, count);
precheck_found, count);
}
if (found != count) {
/*
* LLVM seems to eliminate calls to an empty function
* even if it's marked noinline.
*/
LOG_WARNING("%" PRIu32 " entries found where %" PRIu32
" entries are expected",
found, count);
}
if (precheck_stack_size_min != precheck_stack_size_max) {
/*
Expand Down Expand Up @@ -2577,9 +2585,14 @@ aot_resolve_stack_sizes(AOTCompContext *comp_ctx, AOTObjectData *obj_data)
goto fail;
}
for (i = 0; i < obj_data->func_count; i++) {
/*
* LLVM seems to eliminate calls to an empty function
* even if it's marked noinline.
*/
if (stack_sizes[i] == 0xffffffff) {
aot_set_last_error("incomplete stack usage file.");
goto fail;
LOG_VERBOSE("assuming no stack usage for func #%" PRIu32,
i);
stack_sizes[i] = 0;
}
}
/* TODO add the amount stack to use to make calls */
Expand Down

0 comments on commit fb5d602

Please sign in to comment.