[llvm-bugs] [Bug 32327] New: missed optimization during overflow computation (seto/xor)

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Mar 17 07:57:40 PDT 2017


            Bug ID: 32327
           Summary: missed optimization during overflow computation
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: dvyukov at google.com
                CC: llvm-bugs at lists.llvm.org

clang version 5.0.0 (trunk 294296)
Target: x86_64-unknown-linux-gnu

#include <inttypes.h>
bool foo(uint32_t x, uint32_t y) {
  return !(((uint64_t)(x) * (uint64_t)(y)) >> 32);

$ clang++ overflow.cc -O3 -S -o -

# BB#0:
        movl    %edi, %eax
        mull    %esi
        seto    %al
        xorb    $1, %al

This should be:

        movl    %edi, %eax
        mull    %esi
        setno   %al

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/20170317/2f267c62/attachment.html>

More information about the llvm-bugs mailing list