-
Notifications
You must be signed in to change notification settings - Fork 216
Open
Labels
area-NativeAOT-LLVMLLVM generation for Native AOT compilation (including Web Assembly)LLVM generation for Native AOT compilation (including Web Assembly)
Description
We have this comment in codegen:
// The frontend's contract with the backend is that it will not insert null checks for accesses which
// are inside the "[0..compMaxUncheckedOffsetForNullObject]" range. Thus, we usually need to check not
// just for "null", but "null + small offset". However, for TYP_REF, we know it will either be a valid
// object on heap, or null, and can utilize the more direct form.
Using the "long form" nullcheck costs a lot of code size (measured to be > 1.7% on WasmDebugging), both due to the explicitly longer WASM code sequence and the opaqueness of the check to LLVM.
Thus, the tasks in this issue are as follows:
- Rationalize the current "transient invalid byrefs allowed... but only briefly" null checking model.
- Stop using the long form checks for WASM by setting
compMaxUncheckedOffsetForNullObject
to0
. This would also allow us to delete thewasm-global-base
argument and the (implicit) ABI coupling it creates. - Fix all (upstream) RyuJit bugs due to this. Ensure it is tested upstream (there is already a stress mode, but the value used is a bit larger).
- Fix all (upstream) RyuJit optimization deficiencies due to this. Currently it results in a 1.8% code size increase.
Metadata
Metadata
Assignees
Labels
area-NativeAOT-LLVMLLVM generation for Native AOT compilation (including Web Assembly)LLVM generation for Native AOT compilation (including Web Assembly)