Don't apply the aligned attribute nedlessly
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu bằng cách lần theo Builder::load và lời gọi get_aligned, sau đó điều tra cách rustc cung cấp alignment được đảm bảo cho các kiểu số nguyên, số thực dấu phẩy động, vector và kiểu tổ hợp. Hoàn tất khi backend chỉ phát ra alignment khi nó khác với alignment được đảm bảo của kiểu, đồng thời tránh phát ra alignment này cho các kiểu có kích thước một byte và các cấu trúc được căn chỉnh tự nhiên.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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).
- Ngôn ngữ chính
- Rust
- Star
- 1.2k
- Fork
- 106
- Merge trung bình
- 6 giờ 17 phút
- Pull request đã merge (30 ngày)
- 21
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của rust-lang/rustc_codegen_gcc
-
Re-enable -fno-lto testĐang mởtests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
rust-lang/rustc_codegen_gcc#993 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Enable librsvg tests on Aarch64Đang mởtests
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
rust-lang/rustc_codegen_gcc#992 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
rust-lang/rustc_codegen_gcc#970 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Support `#[no_builtin]`Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
rust-lang/rustc_codegen_gcc#943 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 64/100
rust-lang/rustc_codegen_gcc#930 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của rust-lang/rustc_codegen_gcc
Issue tương tự
-
meta.json, text.txt and try JSON are written non-atomicallyCó thể đã có người làm @qwertymuzaffar đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
qwertymuzaffar/parrot#47 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Alt select PhotocraftĐang mởpriority: medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
storytold/photocraft#8041 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fmt -p: an unprefixed last line without a newline gets one addedCó thể đã có người làm @fixfon đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
jhspetersson/fselect#187 ·
-
documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
writerslogic/holographic-memory#96 ·
Maintainer thường phản hồi trong vòng 1 ngày