Skip to content

portable_simd: gather_or_default compile-time error: "failed to parse bitcode for LTO module", opt-level > 0 #100474

@brson

Description

@brson

I tried this code:

#![feature(portable_simd)]

use std::simd::{f32x8, usizex8};

pub fn table_lookup_exclusive_x16() {
    let table = &[0.0];
    let table_idx1 = usizex8::splat(0);

    let _sample1 = f32x8::gather_or_default(table, table_idx1);
    todo!()
}

Command line:

$ rustc lib.rs --crate-type lib -C opt-level=1
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.65.0-nightly' Reader: 'LLVM 14.0.6-rust-1.65.0-nightly')

error: aborting due to previous error

I expected to see this happen: compilation succeed

Instead, this happened: the above error

opt-level=1 or greater is required. Strangely, in this reduced case the todo!() is required, though in my non-reduced case I had other code there. Compiling as a lib is required - compiling as a bin succeeds.

Meta

rustc --version --verbose:

$ rustc --version --verbose
rustc 1.65.0-nightly (f03ce3096 2022-08-08)
binary: rustc
commit-hash: f03ce30962cf1b2a5158667eabae8bf6e8d1cb03
commit-date: 2022-08-08
host: x86_64-unknown-linux-gnu
release: 1.65.0-nightly
LLVM version: 14.0.6
Backtrace

<backtrace> n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions