Recognize table initialization code in start function and be able to devirtualize based on it

Abierto
#8,869 4 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
42/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
wasm

Línea de trabajo

Empieza por rastrear cómo Binaryen gestiona table.fill, start-function initialization code y element segments, y después compáralo con el comportamiento existente de devirtualization y table-load folding. Define la semántica de opt-in flag y verifica que las initialized regions reconocidas se traten como immutable element-section regions sin cambiar las unrecognized tables.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Producers of wasm code prefer small binary size and may use table.fill instructions to initialize parts of a table (or other constructs, like a loop of increasing indices to initialize i31ref table) instead of emitting large element segments.

It would be nice if binaryen offered a flag (e.g. --trust-table-init-code or something like that) that would make it recognize this pattern and treat it as iff the regions were initialized in element sections and therefore be immutable and allow devirtualization / loads of the table to be folded away.

It could be an opt-in flag.

(In some sense an export of a table - e.g. in multi module scenarios - is in similar situation. One may want with a wasm-merge+wasm-opt+wasm-split the ability to devirtualize -- and would have an assumption that the exported table isn't used by 3rd party modules)

Lenguaje dominante
WebAssembly
Estrellas
8.6k
Forks
885
Merge medio
2 d 1 h
PR fusionados (30 d)
70

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de WebAssembly/binaryen

Todos los issues de WebAssembly/binaryen

Issues similares

Más issues de Compilers

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.