1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -instcombine < %s | FileCheck %s
4 target triple = "aarch64"
6 define <vscale x 4 x i32> @uunpkhi_splat(i16 %a) #0 {
7 ; CHECK-LABEL: @uunpkhi_splat(
8 ; CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[A:%.*]] to i32
9 ; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[TMP1]], i32 0
10 ; CHECK-NEXT: [[UNPACK:%.*]] = shufflevector <vscale x 4 x i32> [[DOTSPLATINSERT]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
11 ; CHECK-NEXT: ret <vscale x 4 x i32> [[UNPACK]]
13 %splat_insert = insertelement <vscale x 8 x i16> poison, i16 %a, i32 0
14 %splat = shufflevector <vscale x 8 x i16> %splat_insert, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
15 %unpack = tail call <vscale x 4 x i32> @llvm.aarch64.sve.uunpkhi.nxv4i32(<vscale x 8 x i16> %splat)
16 ret <vscale x 4 x i32> %unpack
19 define <vscale x 4 x i32> @uunpklo_splat(i16 %a) #0 {
20 ; CHECK-LABEL: @uunpklo_splat(
21 ; CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[A:%.*]] to i32
22 ; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[TMP1]], i32 0
23 ; CHECK-NEXT: [[UNPACK:%.*]] = shufflevector <vscale x 4 x i32> [[DOTSPLATINSERT]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
24 ; CHECK-NEXT: ret <vscale x 4 x i32> [[UNPACK]]
26 %splat_insert = insertelement <vscale x 8 x i16> poison, i16 %a, i32 0
27 %splat = shufflevector <vscale x 8 x i16> %splat_insert, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
28 %unpack = tail call <vscale x 4 x i32> @llvm.aarch64.sve.uunpklo.nxv4i32(<vscale x 8 x i16> %splat)
29 ret <vscale x 4 x i32> %unpack
32 define <vscale x 4 x i32> @sunpkhi_splat(i16 %a) #0 {
33 ; CHECK-LABEL: @sunpkhi_splat(
34 ; CHECK-NEXT: [[TMP1:%.*]] = sext i16 [[A:%.*]] to i32
35 ; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[TMP1]], i32 0
36 ; CHECK-NEXT: [[UNPACK:%.*]] = shufflevector <vscale x 4 x i32> [[DOTSPLATINSERT]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
37 ; CHECK-NEXT: ret <vscale x 4 x i32> [[UNPACK]]
39 %splat_insert = insertelement <vscale x 8 x i16> poison, i16 %a, i32 0
40 %splat = shufflevector <vscale x 8 x i16> %splat_insert, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
41 %unpack = tail call <vscale x 4 x i32> @llvm.aarch64.sve.sunpkhi.nxv4i32(<vscale x 8 x i16> %splat)
42 ret <vscale x 4 x i32> %unpack
45 define <vscale x 4 x i32> @sunpklo_splat(i16 %a) #0 {
46 ; CHECK-LABEL: @sunpklo_splat(
47 ; CHECK-NEXT: [[TMP1:%.*]] = sext i16 [[A:%.*]] to i32
48 ; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[TMP1]], i32 0
49 ; CHECK-NEXT: [[UNPACK:%.*]] = shufflevector <vscale x 4 x i32> [[DOTSPLATINSERT]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
50 ; CHECK-NEXT: ret <vscale x 4 x i32> [[UNPACK]]
52 %splat_insert = insertelement <vscale x 8 x i16> poison, i16 %a, i32 0
53 %splat = shufflevector <vscale x 8 x i16> %splat_insert, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
54 %unpack = tail call <vscale x 4 x i32> @llvm.aarch64.sve.sunpklo.nxv4i32(<vscale x 8 x i16> %splat)
55 ret <vscale x 4 x i32> %unpack
58 declare <vscale x 4 x i32> @llvm.aarch64.sve.uunpkhi.nxv4i32(<vscale x 8 x i16>)
59 declare <vscale x 4 x i32> @llvm.aarch64.sve.uunpklo.nxv4i32(<vscale x 8 x i16>)
60 declare <vscale x 4 x i32> @llvm.aarch64.sve.sunpkhi.nxv4i32(<vscale x 8 x i16>)
61 declare <vscale x 4 x i32> @llvm.aarch64.sve.sunpklo.nxv4i32(<vscale x 8 x i16>)
63 attributes #0 = { "target-features"="+sve" }