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

            Bug ID: 47404
           Summary: Failure to detect pblendvb pattern
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedb...@nondot.org
          Reporter: gabrav...@gmail.com
                CC: craig.top...@gmail.com, llvm-bugs@lists.llvm.org,
                    llvm-...@redking.me.uk, spatel+l...@rotateright.com

typedef char v16i8 __attribute__((vector_size(16)));

v16i8 blend_epi8(v16i8 x, v16i8 y, v16i8 mask)
{
    v16i8 tmp = (mask < 0);
    return (v16i8)((~tmp & x) | (tmp & y));
}

This can can be optimized to `return __builtin_ia32_pblendvb128(x, y, mask);`.
This transformation is done by GCC, but not by LLVM.

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

Reply via email to