aot compiler: Propagate const-ness by ourselves (#3567)

aot_load_const_from_table() hides the const-ness of the
value and prevents optimizations like
https://github.com/bytecodealliance/wasm-micro-runtime/pull/3552.

This commit makes the aot compiler tracks the const-ness
of the value directly in the AOTValue and enables the above
mentioned optimization for XIP.
This commit is contained in:
YAMAMOTO Takashi
2024-06-25 11:57:49 +09:00
committed by GitHub
parent e66b41427f
commit 867dbd8912
4 changed files with 26 additions and 4 deletions

View File

@ -75,10 +75,12 @@ typedef struct AOTValue {
struct AOTValue *next;
struct AOTValue *prev;
LLVMValueRef value;
uint64 const_value; /* valid if is_const is true */
uint32 local_idx;
/* VALUE_TYPE_I32/I64/F32/F64/VOID */
uint8 type;
bool is_local;
uint32 local_idx;
bool is_const;
} AOTValue;
/**