Test from_fn autovectorizes
This commit is contained in:
parent
472230d192
commit
374f5a8091
@ -30,3 +30,13 @@
|
|||||||
}
|
}
|
||||||
c
|
c
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CHECK-LABEL: @auto_vectorize_array_from_fn
|
||||||
|
#[no_mangle]
|
||||||
|
pub fn auto_vectorize_array_from_fn(a: [f32; 4], b: [f32; 4]) -> [f32; 4] {
|
||||||
|
// CHECK: load <4 x float>
|
||||||
|
// CHECK: load <4 x float>
|
||||||
|
// CHECK: fadd <4 x float>
|
||||||
|
// CHECK: store <4 x float>
|
||||||
|
std::array::from_fn(|i| a[i] + b[i])
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user