[llvm-bugs] [Bug 42653] New: [X86][AVX] Rematerializable lower 'allones' subvector masks

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jul 17 07:56:08 PDT 2019


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

            Bug ID: 42653
           Summary: [X86][AVX] Rematerializable lower 'allones' subvector
                    masks
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: llvm-dev at redking.me.uk
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, spatel+llvm at rotateright.com

https://gcc.godbolt.org/z/ESwT78

We should be able to rematerialize masks where the lower subvector half is -1
and the upper 0 by using a smaller destination and the implicit zeroing of the
upper bits:

#include <x86intrin.h>

__m128i low128_128() {
    // GOOD
    return _mm_setr_epi32(-1,-1,-1,-1);
}
__m256i low256_128() {
    // BAD: vpcmpeqd %xmm0, %xmm0, %xmm0
    return _mm256_setr_epi32(-1,-1,-1,-1,0,0,0,0);
}
__m512i low512_128() {
    // BAD: vpcmpeqd %xmm0, %xmm0, %xmm0
    return _mm512_setr_epi32(-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0);
}
__m512i low512_256() {
    // BAD: vpcmpeqd %ymm0, %ymm0, %ymm0
    return _mm512_setr_epi32(-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0);
}

-- 
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/20190717/1521b85c/attachment.html>


More information about the llvm-bugs mailing list