xref: /llvm-project/llvm/test/CodeGen/WebAssembly/simd-nested-shuffles.ll (revision 122b0220fd45ee71acda912b0b712bb8edb6ba46)
1b6dac89cSThomas Lively; RUN: llc < %s -mattr=+simd128 -verify-machineinstrs | FileCheck %s --check-prefixes CHECK
2ed951347SThomas Lively
3ed951347SThomas Lively; Check that shuffles maintain their type when being custom
4ed951347SThomas Lively; lowered. Regression test for bug 39275.
5ed951347SThomas Lively
6ed951347SThomas Livelytarget triple = "wasm32-unknown-unknown"
7ed951347SThomas Lively
8*a781a706SThomas Lively; CHECK: i8x16.shuffle
9ed951347SThomas Livelydefine <4 x i32> @foo(<4 x i32> %x) {
10ed951347SThomas Lively  %1 = shufflevector <4 x i32> %x, <4 x i32> undef,
11ed951347SThomas Lively    <4 x i32> <i32 2, i32 3, i32 undef, i32 undef>
12ed951347SThomas Lively  %2 = shufflevector <4 x i32> %1, <4 x i32> undef,
13ed951347SThomas Lively    <4 x i32> <i32 1, i32 undef, i32 undef, i32 undef>
14ed951347SThomas Lively  %3 = add <4 x i32> %2, %2
15ed951347SThomas Lively  ret <4 x i32> %3
16ed951347SThomas Lively}
17