[llvm-dev] Vectorization in LLVM x86 backend

Charith Mendis via llvm-dev llvm-dev at lists.llvm.org
Mon Aug 21 00:09:31 PDT 2017


Hi all,

Recently I compiled the attached .c file using Clang with "-mavx2 -mfma
-m32 -O3" optimization flags.

First I used -emit-llvm and inspected the LLVM IR (.ll file attached) and
there are no vector instructions in the if.else BB in compressStream
function. Then I got the assembly output of the file in it I can clearly
see vector instructions in the compressStream function (.S file attached)

Neither the SLPVectorizer or the LoopVectorizer is however doing any
vectorization (also checked it using -debug-only flag) as witnessed by the
non-vectorized code in the attached .ll file.

Therefore, the vectorization should happen in the backend(?).

Can I know whether the x86 backend does additional vectorization of scalar
code and if so in which passes?

Thank You.

-- 
Kind regards,
Charith Mendis

Graduate Student,
CSAIL,
Massachusetts Institute of Technology
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170821/4f200ed3/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bzip2.c
Type: text/x-csrc
Size: 63036 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170821/4f200ed3/attachment-0001.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bzip2.ll
Type: application/octet-stream
Size: 88927 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170821/4f200ed3/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bzip2.s
Type: application/octet-stream
Size: 43829 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170821/4f200ed3/attachment-0003.obj>


More information about the llvm-dev mailing list