Potential Compiler Optimization Issue with &Vec<Vec<T>> vs &[Vec<T>]? #124925
Labels
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
rustc version: 1.78
See Godbolt .
In my understanding, the function that accepts
&Vec<Vec>
should have the same optimization as the function that accepts&[Vec]
, because&Vec<Vec>
can be turned into&[Vec]
by simply callingas_slice()
oras_mut_slice()
.However, I found that
&Vec<Vec>
may hinder further vectorization in the nested loop, as shown in the above link.I am wondering whether this is a compiler bug or an intended action?
The text was updated successfully, but these errors were encountered: