summary refs log tree commit diff
path: root/tests/mir-opt/sroa/simd_sroa.rs
blob: 1ae84d3f975bdaa1d18c26c20d9bc219690dd64e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//@ needs-unwind
#![feature(portable_simd)]

// SRoA expands things even if they're unused
// <https://github.com/rust-lang/rust/issues/144621>

use std::simd::Simd;

// EMIT_MIR simd_sroa.foo.ScalarReplacementOfAggregates.diff
pub(crate) fn foo(simds: &[Simd<u8, 16>], _unused: Simd<u8, 16>) {
    // CHECK-LABEL: fn foo
    // CHECK-NOT: [u8; 16]
    // CHECK: let [[SIMD:_.+]]: std::simd::Simd<u8, 16>;
    // CHECK-NOT: [u8; 16]
    // CHECK: [[SIMD]] = copy (*_1)[0 of 1];
    // CHECK-NOT: [u8; 16]
    let a = simds[0];
}