[LLVMbugs] [Bug 20678] New: [AVX512] bitcast and compare of compile-time i1 vector not optimized well

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Aug 15 10:53:33 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20678

            Bug ID: 20678
           Summary: [AVX512] bitcast and compare of compile-time i1 vector
                    not optimized well
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: matt at pharr.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 12906
  --> http://llvm.org/bugs/attachment.cgi?id=12906&action=edit
test case

The attached test program has the following at its start:

  br i1 icmp ne (i16 bitcast (<16 x i1> <i1 true, i1 true, i1 true, i1 true, i1
true, i1 true, i1 true, i1 true, i1 false, i1 false, i1 false, i1 false, i1
false, i1 false, i1 false, i1 false> to i16), i16 0), label %safe_if_run_true,
label %safe_if_after_true

It seems that LLVM isn't determining that this is a compile-time constant test,
since the following code is generated for the function.  (In addition to the
unnecessary movw/testw/je at the start, not also that there is a redundant movw
after the je.)

_add___UM_vyfvyf:                       ## @add___UM_vyfvyf
## BB#0:                                ## %allocas
    movw    $255, %ax
    testw    %ax, %ax
    je    LBB1_2
## BB#1:                                ## %safe_if_run_true
    movw    $255, %ax
    kmovw     %eax, %k1
    vmovups    %zmm1, _array(%rip) {%k1}
LBB1_2:                                 ## %safe_if_after_true
    vaddps     %zmm1, %zmm0, %zmm0
    retq

-- 
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/20140815/f3613d4a/attachment.html>


More information about the llvm-bugs mailing list