[llvm-bugs] [Bug 22703] Loop vectorizer seems very reluctant to make use of PMULLD

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Nov 15 13:10:58 PST 2017


https://bugs.llvm.org/show_bug.cgi?id=22703

Sanjay Patel <spatel+llvm at rotateright.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #3 from Sanjay Patel <spatel+llvm at rotateright.com> ---
The attached program is no longer a valid test. LLVM pre-computes the whole
thing - no multiplies needed!

If we modify main to take 'argc' and the loop to be:
    for (i=0;i<argc;i++) a[i]= (float) (i*i);

...then we can see with r318307:

$ ./clang++ -w -S -O2 -msse4.1 floop.cpp -o -  -emit-llvm | grep mul
  %5 = mul nsw <4 x i32> %vec.ind25, %vec.ind25
  %6 = mul nsw <4 x i32> %step.add26, %step.add26
  %13 = mul nsw <4 x i32> %vec.ind.next28, %vec.ind.next28
  %14 = mul nsw <4 x i32> %step.add26.1, %step.add26.1
  %21 = mul nsw <4 x i32> %vec.ind25.unr, %vec.ind25.unr
  %22 = mul nsw <4 x i32> %step.add26.epil, %step.add26.epil


and:
$ ./clang++ -w -S -O2 -msse4.1 floop.cpp -o -   |grep mul
        pmulld  %xmm6, %xmm6
        pmulld  %xmm5, %xmm5
        pmulld  %xmm5, %xmm5
        pmulld  %xmm6, %xmm6
        pmulld  %xmm0, %xmm0
        pmulld  %xmm1, %xmm1

So I'm going to close this as fixed. If there are other cases where we still do
not produce the right vector multiply, please do open a new bug report.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171115/e28d8f65/attachment.html>


More information about the llvm-bugs mailing list