rust-lang / rust-lang/portable-simd

LLVM error when using f64x8.scatter_select

Open
#290 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-LLVM C-bug
Dominant language
Rust
Stars
1.1k
Forks
108
Avg merge
22h 53m
Merged PRs (30d)
3

Description

I tried this code:

#![feature(portable_simd)]
use std::simd::{f64x8, Mask, usizex8};
fn main() {
    let mut vec = vec![0.0; 129];
    call_simd(&mut vec);
}

fn call_simd(target_slice: &mut [f64]) {
    let accumr = f64x8::splat(1.0);
    accumr.scatter_select(target_slice, Mask::splat(true), usizex8::splat(1));
}

When compiling the code with cargo build --release the process crashes with the error message error: failed to parse bitcode for LTO module: Explicit gep type does not match pointee type of pointer operand (Producer: 'LLVM14.0.6-rust-1.64.0-nightly' Reader: 'LLVM 14.0.6-rust-1.64.0-nightly'). The compiler does not crash at a regular cargo build. I cannot reproduce the error in Rust Playground. This example reproduces the result https://godbolt.org/z/ovzYWeT9M

Meta

rustc --version --verbose:

rustc 1.64.0-nightly (7425fb293 2022-06-30)
binary: rustc
commit-hash: 7425fb293f510a6f138e82a963a3bc599a5b9e1c
commit-date: 2022-06-30
host: x86_64-unknown-linux-gnu
release: 1.64.0-nightly
LLVM version: 14.0.6

I do not have stdsimd or any other crate as an explicit dependency. The Rust edition is 2021.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by compiling the supplied Rust reproducer with cargo build --release and compare it with a regular cargo build, confirming the LLVM bitcode parsing failure. Trace the f64x8::scatter_select lowering and verify that release compilation no longer crashes while the reproducer still builds correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.