Sudakshina Dutta via llvm-dev
2021-Jun-07 02:04 UTC
[llvm-dev] Document to understand vectorized code
Dear Stefanos, I want to understand how the generated code works. For example, the code that I generated using -Rpass=loop-vectorize -Rpass-analysis=loop-vectorize has many shufflevector and other instructions. I wanted to have a document (if there exists any) where an example on loop-vectorization is done with some explanation on the workflow of the code. Thanks, Sudakshina On Mon, Jun 7, 2021 at 7:03 AM Stefanos Baziotis < stefanos.baziotis at gmail.com> wrote:> Hi Sudakshina, > > First, it helps if you can put your code in a godbolt snippet, like this > [1]. It helps people in multiple ways (e.g., they don't have to download > files, they can see exactly what cmd arguments you used, they can > tweak the cmd arguments without having LLVM on their machine etc.). > > Is there any comprehensive tutorial/document to understand generated >> instructions or the semantics of the vectorized code ? > > > This is quite generic, what is more specifically that you want to > understand? Do you want to understand what each individual instruction > does? Do you maybe understand that but > you don't know what is the general method to generate, let's say by hand, > vectorized code (or more specifically, branching vectorized code). Or > maybe, you want to understand > how _LLVM_ generates this code, i.e., the inner workings of the > vectorization passes. > > Best, > Stefanos > > [1] https://godbolt.org/z/8eKqnrMPn > > Στις Κυρ, 6 Ιουν 2021 στις 6:17 π.μ., ο/η Sudakshina Dutta via llvm-dev < > llvm-dev at lists.llvm.org> έγραψε: > >> Dear all, >> >> Greetings. I have generated a vectorized code from a C source file >> (attached). Is there any comprehensive tutorial/document to understand >> generated instructions or the semantics of the vectorized code ? >> >> Thanks, >> Sudakshina >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210607/b2cb1233/attachment.html>
Craig Topper via llvm-dev
2021-Jun-07 02:11 UTC
[llvm-dev] Document to understand vectorized code
There's some notes here https://llvm.org/docs/Vectorizers.html but I didn't look too closely at it. If you compile with -fno-discard-values names or use a debug build, some of the basic blocks will be named similar to the CFG diagram in this section https://llvm.org/docs/Vectorizers.html#epilogue-vectorization ~Craig On Sun, Jun 6, 2021 at 7:04 PM Sudakshina Dutta via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Dear Stefanos, > > I want to understand how the generated code works. For example, the code > that I generated using -Rpass=loop-vectorize -Rpass-analysis=loop-vectorize > has many shufflevector and other instructions. I wanted to have a document > (if there exists any) where an example on loop-vectorization is done with > some explanation on the workflow of the code. > > Thanks, > Sudakshina > > On Mon, Jun 7, 2021 at 7:03 AM Stefanos Baziotis < > stefanos.baziotis at gmail.com> wrote: > >> Hi Sudakshina, >> >> First, it helps if you can put your code in a godbolt snippet, like this >> [1]. It helps people in multiple ways (e.g., they don't have to download >> files, they can see exactly what cmd arguments you used, they can >> tweak the cmd arguments without having LLVM on their machine etc.). >> >> Is there any comprehensive tutorial/document to understand generated >>> instructions or the semantics of the vectorized code ? >> >> >> This is quite generic, what is more specifically that you want to >> understand? Do you want to understand what each individual instruction >> does? Do you maybe understand that but >> you don't know what is the general method to generate, let's say by hand, >> vectorized code (or more specifically, branching vectorized code). Or >> maybe, you want to understand >> how _LLVM_ generates this code, i.e., the inner workings of the >> vectorization passes. >> >> Best, >> Stefanos >> >> [1] https://godbolt.org/z/8eKqnrMPn >> >> Στις Κυρ, 6 Ιουν 2021 στις 6:17 π.μ., ο/η Sudakshina Dutta via llvm-dev < >> llvm-dev at lists.llvm.org> έγραψε: >> >>> Dear all, >>> >>> Greetings. I have generated a vectorized code from a C source file >>> (attached). Is there any comprehensive tutorial/document to understand >>> generated instructions or the semantics of the vectorized code ? >>> >>> Thanks, >>> Sudakshina >>> _______________________________________________ >>> LLVM Developers mailing list >>> llvm-dev at lists.llvm.org >>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >>> >> _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210606/ad332018/attachment.html>