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

            Bug ID: 43507
           Summary: v8i1 build_vector legalizer miscompile
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedb...@nondot.org
          Reporter: benny....@gmail.com
                CC: craig.top...@gmail.com, llvm-bugs@lists.llvm.org,
                    llvm-...@redking.me.uk, spatel+l...@rotateright.com

$ cat t.ll
define <8 x i1> @ham(i64 %arg) {
  %tmp = trunc i64 %arg to i1
  %tmp1 = insertelement <8 x i1> undef, i1 %tmp, i32 0
  %tmp2 = shufflevector <8 x i1> %tmp1, <8 x i1> undef, <8 x i32>
zeroinitializer
  ret <8 x i1> %tmp2
}

$ llc -mcpu=skx < t.ll
ham:
        xorl    %eax, %eax
        testb   %dil, %dil
        movl    $255, %ecx
        cmovel  %eax, %ecx
        kmovd   %ecx, %k0
        vpmovm2w        %k0, %xmm0
        retq

This drops the trunc to i1, giving wrong results for all even inputs > 0. I'd
expect `testb $1, %dil` here.

-- 
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