[llvm-bugs] [Bug 41770] New: Generated code contains unnecessary movzx

via llvm-bugs llvm-bugs at lists.llvm.org
Mon May 6 09:28:41 PDT 2019


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

            Bug ID: 41770
           Summary: Generated code contains unnecessary movzx
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: mvels at google.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

I ran into this playing around with alternative SSO encodings and simplified in
godbolt. https://gcc.godbolt.org/z/n2BNiB

It correctly recognizes the jns opportunity, but then adds an additional movzx
at the end.

GetLength(str const&):
        movzx   eax, BYTE PTR [rdi+15]
        sub     al, 15
        js      .L2
        movzx   eax, al
        ret
.L2:
        movabs  rax, 9223372036854775807
        and     rax, QWORD PTR [rdi+8]
        ret

-- 
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/20190506/5c7f2623/attachment-0001.html>


More information about the llvm-bugs mailing list