[llvm-bugs] [Bug 35878] Loop Vectorizer does not recognize packed load

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jan 9 13:01:39 PST 2018


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

Davide Italiano <davide at freebsd.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |davide at freebsd.org
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Davide Italiano <davide at freebsd.org> ---
Your program exhibits UB, as you're missing a `return`.

Change it to:

#include <cstdint>
int foo(uint32_t* __restrict r, uint32_t* __restrict ptr)
{
    for (int j = 0; j < 8; ++j)
        r[j] = *(ptr++);
    return 0;
}

And you get:

foo(unsigned int*, unsigned int*): # @foo(unsigned int*, unsigned int*)
  vmovups ymm0, ymmword ptr [rsi]
  vmovups ymmword ptr [rdi], ymm0
  xor eax, eax
  vzeroupper
  ret


which is a vectorized sequence.

-- 
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/20180109/51a1eacc/attachment.html>


More information about the llvm-bugs mailing list