[llvm-bugs] [Bug 50810] New: [SIMD] pattern for i32x4.dot_i16x8_s not recognized

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jun 22 15:48:47 PDT 2021


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

            Bug ID: 50810
           Summary: [SIMD] pattern for i32x4.dot_i16x8_s not recognized
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: WebAssembly
          Assignee: unassignedbugs at nondot.org
          Reporter: clang at evan.coeusgroup.com
                CC: llvm-bugs at lists.llvm.org

With -msimd128 -O3, the compiler wont't recognize the following snippet as an
i32x4.dot_i16x8_s.

It also scalarizes a lot of stuff; the WASM backend seems to have a lot of
trouble with non-128-bit vectors.  Even if this wasn't recognized as a dot
product, I'd hope to see some extmuls (or at least i16x8.extend_low/high and
i32x4.mul) and shuffles for this.  I can file another bug for that if you want.

Anyways, here is the example (Compiler Explorer:
https://godbolt.org/z/an4jKTnf5):



#include <stdint.h>

typedef  int16_t i16x8 __attribute__((__vector_size__(16)));
typedef  int32_t i32x4 __attribute__((__vector_size__(16)));

i32x4
dot(i16x8 a, i16x8 b) {
    int32_t prod __attribute__((__vector_size__(32))) =
        __builtin_convertvector(a, __typeof__(prod)) *
        __builtin_convertvector(b, __typeof__(prod)); 
    return
        __builtin_shufflevector(prod, prod, 0, 2, 4, 6) +
        __builtin_shufflevector(prod, prod, 1, 3, 5, 7);
}

-- 
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/20210622/674da07b/attachment.html>


More information about the llvm-bugs mailing list