Wasm-opt not deduplicating repeated struct.gets on unchanged local
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 38/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- wasm
- Área
- compilers
Línea de trabajo
Empieza con wasm-opt y reproduce el patrón repetido de local.get/struct.get del issue. Sigue el comportamiento del optimizer para los locals que no cambian y determina dónde podrían reconocerse los struct.gets repetidos. Se considerará terminado cuando el patrón esté deduplicado, se preserve el flujo de control mostrado y se haya comprobado el impacto en el tamaño del código o el rendimiento.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Consider the larger wasm snippet below. There are multiple instances of the same group of instructions:
local.get $var0
struct.get $#Top $field0
$var0 doesn't change between these struct.gets. I would expect wasm-opt to be able to identify this, do the lookup once and store it in a local prior to entering the block. This would save both code size and performance. We have some functions with hundreds of these patterns so the code size savings from this could be significant.
...
block $label1
block $label0 (result (ref $#Top))
local.get $var0
br_on_non_null $label0
local.get $var0
global.get $C6307 SymbolConstant(#[]=)
local.get $var4
call $_typeArgumentsToList
local.get $var3
call $_positionalParametersToList
local.get $var10
call $_namedParametersToMap
call $_Invocation.method
call $NoSuchMethodError._throwWithInvocation
unreachable
end $label0
local.tee $var0
struct.get $#Top $field0
i32.const 15
i32.eq
br_if $label1
local.get $var0
struct.get $#Top $field0
i32.const 16
i32.eq
if
local.get $var0
ref.as_non_null
local.get $var4
local.get $var3
global.get $C5979 WasmArray<Object>[0]
call $__ConstMap&_HashFieldBase&MapMixin&_HashBase&_OperatorEqualsAndHashCode&_LinkedHashMapMixin&_MapCreateIndexMixin&_UnmodifiableMapMixin.[]= invocation type checker
drop
return
end
local.get $var0
struct.get $#Top $field0
i32.const 17
i32.eq
br_if $label1
local.get $var0
struct.get $#Top $field0
i32.const 18
i32.eq
if
local.get $var0
ref.as_non_null
local.get $var4
local.get $var3
global.get $C5979 WasmArray<Object>[0]
i32.const 0
call_indirect (param (ref $#Top) (ref $Array<_Type>) (ref $Array<Object?>) (ref $Array<Object?>)) (result (ref null $#Top)) $&
drop
return
end
local.get $var0
struct.get $#Top $field0
i32.const 51
i32.eq
if
local.get $var0
ref.as_non_null
local.get $var4
local.get $var3
global.get $C5979 WasmArray<Object>[0]
call $CrossappCacheStorage.[]= invocation type checker
drop
return
end
...
- Lenguaje dominante
- WebAssembly
- Estrellas
- 8.6k
- Forks
- 892
- Merge medio
- 1 d 18 h
- PR fusionados (30 d)
- 79
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de WebAssembly/binaryen
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
WebAssembly/binaryen#9185 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
WebAssembly/binaryen#9135 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 Medio día Aptitud para principiantes 76/100
WebAssembly/binaryen#9018 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
WebAssembly/binaryen#9186 ·
Los mantenedores suelen responder en 1 día
-
LoopInvariantCodeMotion: `struct.new` is hoisted out of a loop, so all iterations share one objectAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
WebAssembly/binaryen#9184 ·
Los mantenedores suelen responder en 1 día
Todos los issues de WebAssembly/binaryen
Issues similares
-
self-host checker: E021 bound check reads an untyped literal at i32, not the type the call bindsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
JakeChampion/lang#11055 ·
Los mantenedores suelen responder en 1 día
-
codegen: memref.collapse_shape in an mlir! block leaves an affine.apply that is never loweredAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
rhalbersma/xstd-bits#307 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día