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: tliv...@google.com
          Reporter: z...@google.com
                CC: llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to