Open Bug 1887045 Opened 1 year ago Updated 6 months ago

Add a wasm array bounds check elimination pass

Categories

(Core :: JavaScript: WebAssembly, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: rhunt, Unassigned)

References

(Blocks 1 open bug)

Details

We have a wasm linear memory bounds check elimination pass (see WasmBCE.cpp). We should investigate if we could do similar for wasm arrays.

One pattern that could be interesting is to eliminate bounds checks for cases where the array is allocated in a given function with a constant length, followed by a series of array.get/set. Although ideally the code would be using array.new for this.

I'd also wonder if there are cases where we could determine a single upfront bounds check for a loop that performs many array.get/set's based off of an induction variable. However, that may mess up precise trapping offsets, which we have avoided so far.

Blocks: wasm-gc-perf
No longer blocks: wasm-gc
You need to log in before you can comment on or make changes to this bug.