blob: 8822a2c6dc35c17428849795afbeb483201d483b [file] [log] [blame] [raw]
// Compile with -C opt-level=3 -C target-cpu=native to see autovectorization
// assumes input's length is a multiple of 64
pub fn sum_array(input: &[i32]) -> i32 {
if input.len() & 63 != 0 {
unsafe { std::hint::unreachable_unchecked() }
}
input.iter().sum()
}