[llvm-dev] Vector evolution?

Florian Hahn via llvm-dev llvm-dev at lists.llvm.org
Tue Sep 1 08:51:05 PDT 2020



> On Sep 1, 2020, at 16:23, Alexandre Bique <bique.alexandre at gmail.com> wrote:
> 
> On Tue, Sep 1, 2020 at 5:10 PM Florian Hahn <florian_hahn at apple.com> wrote:
>> The loop vectorizer does not really handle loops that already operate on vectors, so that is why the loop using v4f32 does not get widened.
>> 
>> Arguably the user explicitly asked for 4xfloat vectors in the v4f32 version, so that is what gets generated.
> 
> In my case I have tons of legacy code written for SSE2 and if the
> compiler can make a better and correct version of it, why not?

Right, that’s also a reasonable argument. 

Cases like those should get unrolled sufficiently already and all that needs to be done is combining multiple instructions to their wider versions. This can probably be done relatively easily in either the SLP vectorizer [1]  or VectorCombine [2[

[1] https://github.com/llvm/llvm-project/blob/master/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
[2] https://github.com/llvm/llvm-project/blob/master/llvm/lib/Transforms/Vectorize/VectorCombine.cp

>> (Those kinds of issues are better to discuss on https://bugs.llvm.org/ IMO, because it is easier to keep track of the progress on the issue).
> 
> That is noted, but I can't think of it as a bug unless I understand the issue.

I would not say it is a bug, but rather a missing transform. The naming of https://bugs.llvm.org/ might imply that it is only for bugs, but in practice it is used to collect missed optimizations, suggestions for new features and so on as well.

Cheers,
Florian


More information about the llvm-dev mailing list