Enable SLP for O2/Os optimization levels

オープン
#166,617 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust

調査の方向性

Start by reading the linked LLVM issue #246274 and the related Rust issue #43702 to understand the frontend behavior implicated here. Reproduce the example with opt-level=2 and opt-level=s, then trace how Rust lowers the array construction and XOR operations. Done means the generated code uses word-wise or otherwise optimized XOR operations at those levels; the issue names no Rust source file or test to start from.

索引モデルが issue の本文から書いたものです。

説明

A-array A-autovectorization A-codegen A-LLVM C-optimization I-slow S-has-mcve T-compiler

The following Rust code:

const N: usize = 16;

pub fn xor_into(a: &[u8; N], b: &[u8; N], dst: &mut [u8; N]) {
    *dst =  core::array::from_fn(|i| a[i] ^ b[i]);
}

Results in assembly which performs XOR byte-by-byte with opt-level=2/s , see: https://rust.godbolt.org/z/xW4xKE8a6

Such code is extremely common in cryptography and arguably should use at least word-wise XORing with opt-level=2/s.

In the LLVM issue it was identified as a mostly frontend issue.

Relevant issues: https://github.com/rust-lang/rust/issues/43702 https://github.com/RustCrypto/utils/issues/1621

主要言語
Rust
スター
123k
フォーク
16.6k
平均マージ
2日 17時間
マージ済み PR(30日)
532

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

rust-lang/rust のほかの issue

rust-lang/rust の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。