xref: /llvm-project/llvm/test/CodeGen/X86/masked_compressstore_isel.ll (revision c91f2a259f378a9a4817c675b9a01557fcf7cae8)
1; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4
2; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -start-after=codegenprepare -stop-before finalize-isel | FileCheck %s
3
4define void @_Z3fooiPiPs(<8 x i32> %gepload, <8 x i1> %0) #0 {
5  ; CHECK-LABEL: name: _Z3fooiPiPs
6  ; CHECK: bb.0.entry:
7  ; CHECK-NEXT:   liveins: $ymm0, $xmm1
8  ; CHECK-NEXT: {{  $}}
9  ; CHECK-NEXT:   [[COPY:%[0-9]+]]:vr128x = COPY $xmm1
10  ; CHECK-NEXT:   [[COPY1:%[0-9]+]]:vr256x = COPY $ymm0
11  ; CHECK-NEXT:   [[VPSLLWZ128ri:%[0-9]+]]:vr128x = VPSLLWZ128ri [[COPY]], 15
12  ; CHECK-NEXT:   [[VPMOVW2MZ128kr:%[0-9]+]]:vk16wm = VPMOVW2MZ128kr killed [[VPSLLWZ128ri]]
13  ; CHECK-NEXT:   [[VPMOVDWZ256rr:%[0-9]+]]:vr128x = VPMOVDWZ256rr [[COPY1]]
14  ; CHECK-NEXT:   VPCOMPRESSWZ128mrk $noreg, 1, $noreg, 0, $noreg, killed [[VPMOVW2MZ128kr]], killed [[VPMOVDWZ256rr]] :: (store unknown-size into `ptr null`, align 1)
15  ; CHECK-NEXT:   RET 0
16entry:
17  %1 = trunc <8 x i32> %gepload to <8 x i16>
18  tail call void @llvm.masked.compressstore.v8i16(<8 x i16> %1, ptr null, <8 x i1> %0)
19  ret void
20}
21
22
23define void @_Z3foo2iPiPs(<8 x i32> %gepload, <8 x i1> %0) #0 {
24  ; CHECK-LABEL: name: _Z3foo2iPiPs
25  ; CHECK: bb.0.entry:
26  ; CHECK-NEXT:   liveins: $ymm0, $xmm1
27  ; CHECK-NEXT: {{  $}}
28  ; CHECK-NEXT:   [[COPY:%[0-9]+]]:vr128x = COPY $xmm1
29  ; CHECK-NEXT:   [[COPY1:%[0-9]+]]:vr256x = COPY $ymm0
30  ; CHECK-NEXT:   [[VPSLLWZ128ri:%[0-9]+]]:vr128x = VPSLLWZ128ri [[COPY]], 15
31  ; CHECK-NEXT:   [[VPMOVW2MZ128kr:%[0-9]+]]:vk16wm = VPMOVW2MZ128kr killed [[VPSLLWZ128ri]]
32  ; CHECK-NEXT:   [[VPMOVDWZ256rr:%[0-9]+]]:vr128x = VPMOVDWZ256rr [[COPY1]]
33  ; CHECK-NEXT:   VPCOMPRESSWZ128mrk $noreg, 1, $noreg, 0, $noreg, killed [[VPMOVW2MZ128kr]], killed [[VPMOVDWZ256rr]] :: (store unknown-size into `ptr null`, align 16)
34  ; CHECK-NEXT:   RET 0
35entry:
36  %1 = trunc <8 x i32> %gepload to <8 x i16>
37  tail call void @llvm.masked.compressstore.v8i16(<8 x i16> %1, ptr align 16 null, <8 x i1> %0)
38  ret void
39}
40
41; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: write)
42declare void @llvm.masked.compressstore.v8i16(<8 x i16>, ptr nocapture, <8 x i1>) #1
43
44attributes #0 = { "target-cpu"="icelake-server" }
45attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: write) }
46