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:
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user