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

@ -28,6 +28,7 @@ aot_compile_op_i32_const(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
}
PUSH_I32(value);
SET_CONST((uint64)(uint32)i32_const);
return true;
fail:
return false;
@ -55,6 +56,7 @@ aot_compile_op_i64_const(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
}
PUSH_I64(value);
SET_CONST((uint64)i64_const);
return true;
fail:
return false;