Skip to content

Commit 786877a

Browse files
committed
update comments and warning info, bitmaps section in llvm profdata shouldn't be used in PGO
1 parent 836e6c4 commit 786877a

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

core/iwasm/aot/aot_runtime.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4887,7 +4887,7 @@ aot_dump_pgo_prof_data_to_buf(AOTModuleInstance *module_inst, char *buf,
48874887
prof_header.num_prof_counters = num_prof_counters;
48884888
prof_header.names_size = prof_names_size;
48894889
prof_header.value_kind_last = 1;
4890-
/* TODO: add __llvm_prf_bits support in the future */
4890+
/* __llvm_prf_bits won't be used in PGO, set dummy value here */
48914891
prof_header.num_prof_bitmaps = 0;
48924892
prof_header.bitmap_delta = 0;
48934893

@@ -4921,7 +4921,7 @@ aot_dump_pgo_prof_data_to_buf(AOTModuleInstance *module_inst, char *buf,
49214921
prof_data_64->func_ptr = prof_data->func_ptr;
49224922
prof_data_64->values = (uint64)(uintptr_t)prof_data->values;
49234923
prof_data_64->num_counters = prof_data->num_counters;
4924-
/* TODO: add __llvm_prf_bits support in the future */
4924+
/* __llvm_prf_bits won't be used in PGO, set dummy value here */
49254925
prof_data_64->num_bitmaps = 0;
49264926
prof_data_64->num_value_sites[0] = prof_data->num_value_sites[0];
49274927
prof_data_64->num_value_sites[1] = prof_data->num_value_sites[1];

core/iwasm/aot/aot_runtime.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -437,9 +437,9 @@ typedef struct AOTFrame {
437437
} AOTFrame;
438438

439439
#if WASM_ENABLE_STATIC_PGO != 0
440-
/* TODO: bitmaps fields in LLVMProfileRawHeader, LLVMProfileData,
441-
* LLVMProfileData_64 all dummy fields, remove this comment when __llvm_prf_bits
442-
* are actual supported */
440+
/* The bitmaps fields in LLVMProfileRawHeader, LLVMProfileData,
441+
* LLVMProfileData_64 all dummy fields, it's used in MC/DC code coverage
442+
* instead of PGO. See https://llvm.org/docs/InstrProfileFormat.html#bitmap */
443443
typedef struct LLVMProfileRawHeader {
444444
uint64 magic;
445445
uint64 version;

core/iwasm/compilation/aot_emit_aot_file.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3380,7 +3380,8 @@ aot_resolve_object_data_sections(AOTObjectData *obj_data)
33803380
}
33813381
else if (obj_data->comp_ctx->enable_llvm_pgo
33823382
&& !strcmp(name, "__llvm_prf_bits")) {
3383-
LOG_WARNING("__llvm_prf_bits section is not supported yet");
3383+
LOG_WARNING("__llvm_prf_bits section is not supported and "
3384+
"shouldn't be used in PGO.");
33843385
return false;
33853386
}
33863387

0 commit comments

Comments
 (0)