[llvm-bugs] [Bug 38960] New: [X86] Poor codegen for comieq/comine intrinsics feeding a branch

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Sep 15 13:32:55 PDT 2018


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

            Bug ID: 38960
           Summary: [X86] Poor codegen for comieq/comine intrinsics
                    feeding a branch
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: craig.topper at gmail.com
                CC: llvm-bugs at lists.llvm.org

#include <x86intrin.h>

void foo();

void test_mm_comieq_ss(__m128 A, __m128 B) {
  if (_mm_comieq_ss(A, B))
    foo();
}

Produces

test_mm_comieq_ss(float __vector(4), float __vector(4)):           #
@test_mm_comieq_ss(float __vector(4), float __vector(4))
        vcomiss %xmm1, %xmm0
        setnp   %al
        sete    %cl
        andb    %al, %cl
        movzbl  %cl, %eax
        testl   %eax, %eax
        je      .LBB0_1
        jmp     foo()                 # TAILCALL
.LBB0_1:
        retq

Ideally we should only produce a vcomiss and two conditional jumps.

-- 
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/20180915/e1c1acd2/attachment.html>


More information about the llvm-bugs mailing list