[llvm-bugs] [Bug 39381] New: Redundant clears (vpxor) generated for single __m128i initialize-with-zero

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Oct 22 09:59:23 PDT 2018


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

            Bug ID: 39381
           Summary: Redundant clears (vpxor) generated for single __m128i
                    initialize-with-zero
           Product: clang
           Version: 7.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: casey at mollyrocket.com
                CC: llvm-bugs at lists.llvm.org

When clearing an __m128i to zero using = {} syntax, sometimes LLVM generates a
second clear for the same (already cleared) register.  Here xmm1 is cleared
with vpxor, and then a few instructions later, cleared again, even though it
has not been touched in the interim:

https://godbolt.org/z/TkTlza

This appears to happen in this construction even when using _mm_setzero_si128:

https://godbolt.org/z/eqhJe2

And the spurious clear also seems impervious to reorganization, so if you move
the lines around, create a zero value and assign using it, declare and then
set, etc., they all produce basically the same code with the extra clear.

- Casey

-- 
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/20181022/a83eb212/attachment.html>


More information about the llvm-bugs mailing list