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

            Bug ID: 42818
           Summary: Missed optimization for std::div
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

std::div - Computes both the quotient and the remainder of the division of the
numerator x by the denominator y.

int d() {

    std::div_t q = std::div(12, 6);

    return q.rem;
}

Clang trunk -O3
d():                              # @mxain()
        push    rax
        mov     edi, 12
        mov     esi, 6
        call    div
        shr     rax, 32
        pop     rcx
        ret

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to