Don't apply the aligned attribute nedlessly
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
Línea de trabajo
Empieza rastreando Builder::load y la llamada a get_aligned; después, investiga cómo rustc expone la alineación garantizada para los tipos enteros, de coma flotante, vectoriales y compuestos. La tarea estará terminada cuando el backend emita la alineación solo cuando difiera de la alineación garantizada del tipo, lo que incluye evitarla para los tipos cuyo tamaño es un byte y las estructuras alineadas de forma natural.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Currently, we apply the aligned attribute to all integers, regardless of their actual aligement.
This leads to such gems as this:
__int8_t __attribute__((aligned(1)))
Since a byte-sized type has a size of 1(by definition), it's alignment can be 1 and only 1.
This attribute is thus unneeded, and only leads to increased memory consumption, and more confusing debug strings. It could also inhibit some optimizations(no examples of that yet, but it is not hard to imagine some of them can't deal with under / over aligned types, and ignore types with explicit alignment altogether).
While removing this attribute for byte-sized types is an easy fix, other types pose a bigger challenge.
Ideally, we'd need an API to query GCC about the aligement of intigers / floats / vectors, and then use that API to not emit this attribute when not necessary(eg. a structure composed of floats with aligement 4 is alteady correctly aligned by the virtue of containing floats).
For example, Builder::load could check if the requested align: Align differs from the one already guaranteed for a type(by checking the aligement on the rustc side of things). We could then call get_aligned if and only if this aligement differs, reducing the usage of this attribute(thus reducing memory usage).
- Lenguaje dominante
- Rust
- Estrellas
- 1.2k
- Forks
- 106
- Merge medio
- 6 h 17 min
- PR fusionados (30 d)
- 21
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 rust-lang/rustc_codegen_gcc
-
Re-enable -fno-lto testAbiertotests
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
rust-lang/rustc_codegen_gcc#993 ·
Los mantenedores suelen responder en 1 día
-
Enable librsvg tests on Aarch64Abiertotests
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
rust-lang/rustc_codegen_gcc#992 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
rust-lang/rustc_codegen_gcc#970 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
-
Support `#[no_builtin]`Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
rust-lang/rustc_codegen_gcc#943 ·
Los mantenedores suelen responder en 1 día
-
documentation
Dificultad 3/5 1-2 días Aptitud para principiantes 64/100
rust-lang/rustc_codegen_gcc#930 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de rust-lang/rustc_codegen_gcc
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
nautechsystems/nautilus_trader#5365 ·
Los mantenedores suelen responder en 1 día
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
IntersectMBO/developer-experience#347 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
registrystack/registry-stack#2168 ·
Los mantenedores suelen responder en 1 día
-
bug crate: 3d help wanted triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
kornia/kornia-rs#1203 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día