Don't apply the aligned attribute nedlessly
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず Builder::load と get_aligned 呼び出しを追跡し、次に rustc が整数型、浮動小数点型、ベクター型、複合型について保証されるアラインメントをどのように公開しているかを調べます。バックエンドが、型に保証されたアラインメントと異なる場合にのみアラインメントを出力し、バイトサイズの型や自然にアラインされた構造体については出力を避けるようになれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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).
- 主要言語
- Rust
- スター
- 1.2k
- フォーク
- 106
- 平均マージ
- 6時間 47分
- マージ済み PR(30日)
- 21
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rust-lang/rustc_codegen_gcc のほかの issue
-
tests
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
rust-lang/rustc_codegen_gcc#993 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 43/100
rust-lang/rustc_codegen_gcc#1003 ·
メンテナーはふだん 1 日以内に返信
-
tests
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
rust-lang/rustc_codegen_gcc#992 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
rust-lang/rustc_codegen_gcc#970 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
rust-lang/rustc_codegen_gcc#943 ·
メンテナーはふだん 1 日以内に返信
rust-lang/rustc_codegen_gcc の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
EmbarkStudios/cargo-deny#910 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
tursodatabase/turso#10054 ·
メンテナーはふだん 1 日以内に返信
-
build: Update rust version対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンdependencies
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
ibm-granite-community/granite-cli#229 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
orottier/web-audio-api-rs#658 ·