[llvm-bugs] [Bug 52013] New: Spurious shuffle shows up in generated code

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Sep 29 09:58:36 PDT 2021


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

            Bug ID: 52013
           Summary: Spurious shuffle shows up in generated code
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: WebAssembly
          Assignee: tlively at google.com
          Reporter: zhin at google.com
                CC: llvm-bugs at lists.llvm.org

Ptal https://godbolt.org/z/dPa48Gez1 this is a reduced test case based on this
xnnpack source file
https://github.com/google/XNNPACK/blob/0bf8afaa43601ab37407f262c90ec3c02436a600/src/f32-spmm/gen/32x1-minmax-wasmsimd-x86.c

What's interesting is that i8x16.shuffle shows up twice in the generated code,
but there is no explicit use of shuffle in the source.

Looking at the second i8x16.shuffle, on line 52 of the generated code:

30        v128.load32_splat       0:p2align=0
31        local.set       10
...
51        local.get 10
52        i8x16.shuffle   0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3

it tries to shuffle the result of a v128.load32_splat. Which isn't needed:
- the shuffle is a 32x4 splat
- we already did a splat in the v128.load32_splat
- the shuffle is actually a nop

-- 
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/20210929/393f33ec/attachment-0001.html>


More information about the llvm-bugs mailing list