This type of optimization is also known as compile-time constant expression folding.
The problem with expanding it to include function calls is that it compromises binary compatibility. A code change on a function that results in a different range or has different side effects, will not be realized unless the caller is recompiled.
https://labs.leaningtech.com/blog/reducing-webassembly-size-...
The problem with expanding it to include function calls is that it compromises binary compatibility. A code change on a function that results in a different range or has different side effects, will not be realized unless the caller is recompiled.
https://www.graalvm.org/latest/graalvm-as-a-platform/languag...