[llvm-bugs] [Bug 47825] New: LLVM too aggressive about using vector ctpop

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Oct 13 08:20:38 PDT 2020


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

            Bug ID: 47825
           Summary: LLVM too aggressive about using vector ctpop
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: dave at znu.io
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, pengfei.wang at intel.com,
                    spatel+llvm at rotateright.com

The following code generates quite sub-optimal assembly on targets that don't
have a vector population count instruction:

__mmask8 popCountLessThanOrEqualToOne(__m512i value) {
    return _mm512_testn_epi64_mask(value, value - 1);
}

It seems like the generic optimization pass(es) are converting this into a
vector "ctpop" without checking whether the back end has the instruction or
not. Whoops.

-- 
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/20201013/ecd5beb2/attachment.html>


More information about the llvm-bugs mailing list