aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2024-02-05 17:46:45 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2024-02-05 18:02:03 +0000
commit2096e57905a20903f668848ffd11e6130bfa58e2 (patch)
treebb38a09fee77dda9c969b1047ade4dda5a58205f
parent8fa1e5771bbd080c8a2a11c0579a3082cedbf94a (diff)
downloadllvm-2096e57905a20903f668848ffd11e6130bfa58e2.zip
llvm-2096e57905a20903f668848ffd11e6130bfa58e2.tar.gz
llvm-2096e57905a20903f668848ffd11e6130bfa58e2.tar.bz2
[X86] addConstantComments - add FP16 MOVSH asm comments support
-rw-r--r--llvm/lib/Target/X86/X86MCInstLower.cpp6
-rw-r--r--llvm/test/CodeGen/X86/avx512fp16-fma-intrinsics.ll12
-rw-r--r--llvm/test/CodeGen/X86/avx512fp16-mov.ll88
-rw-r--r--llvm/test/CodeGen/X86/stack-folding-fp-avx512fp16.ll2
4 files changed, 60 insertions, 48 deletions
diff --git a/llvm/lib/Target/X86/X86MCInstLower.cpp b/llvm/lib/Target/X86/X86MCInstLower.cpp
index ec012fa..b336ba3 100644
--- a/llvm/lib/Target/X86/X86MCInstLower.cpp
+++ b/llvm/lib/Target/X86/X86MCInstLower.cpp
@@ -1875,6 +1875,12 @@ static void addConstantComments(const MachineInstr *MI,
printZeroUpperMove(MI, OutStreamer, 64, 128, "mem[0],zero");
break;
+ MASK_AVX512_CASE(X86::VMOVSHZrm)
+ case X86::VMOVSHZrm_alt:
+ printZeroUpperMove(MI, OutStreamer, 16, 128,
+ "mem[0],zero,zero,zero,zero,zero,zero,zero");
+ break;
+
case X86::MOVSSrm:
case X86::VMOVSSrm:
MASK_AVX512_CASE(X86::VMOVSSZrm)
diff --git a/llvm/test/CodeGen/X86/avx512fp16-fma-intrinsics.ll b/llvm/test/CodeGen/X86/avx512fp16-fma-intrinsics.ll
index 06dd5bf..be0ef7a 100644
--- a/llvm/test/CodeGen/X86/avx512fp16-fma-intrinsics.ll
+++ b/llvm/test/CodeGen/X86/avx512fp16-fma-intrinsics.ll
@@ -531,8 +531,10 @@ define void @fmadd_sh_mask_memfold(ptr %a, ptr %b, i8 %c) {
; X86-NEXT: kmovb {{[0-9]+}}(%esp), %k1 # encoding: [0xc5,0xf9,0x90,0x4c,0x24,0x0c]
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x08]
; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx # encoding: [0x8b,0x4c,0x24,0x04]
-; X86-NEXT: vmovsh (%ecx), %xmm0 # encoding: [0x62,0xf5,0x7e,0x08,0x10,0x01]
-; X86-NEXT: vmovsh (%eax), %xmm1 # encoding: [0x62,0xf5,0x7e,0x08,0x10,0x08]
+; X86-NEXT: vmovsh {{.*#+}} xmm0 = mem[0],zero,zero,zero,zero,zero,zero,zero
+; X86-NEXT: # encoding: [0x62,0xf5,0x7e,0x08,0x10,0x01]
+; X86-NEXT: vmovsh {{.*#+}} xmm1 = mem[0],zero,zero,zero,zero,zero,zero,zero
+; X86-NEXT: # encoding: [0x62,0xf5,0x7e,0x08,0x10,0x08]
; X86-NEXT: vfmadd213sh %xmm0, %xmm0, %xmm1 # encoding: [0x62,0xf6,0x7d,0x08,0xa9,0xc8]
; X86-NEXT: vmovsh %xmm1, %xmm0, %xmm0 {%k1} # encoding: [0x62,0xf5,0x7e,0x09,0x10,0xc1]
; X86-NEXT: vmovsh %xmm0, (%ecx) # encoding: [0x62,0xf5,0x7e,0x08,0x11,0x01]
@@ -540,8 +542,10 @@ define void @fmadd_sh_mask_memfold(ptr %a, ptr %b, i8 %c) {
;
; X64-LABEL: fmadd_sh_mask_memfold:
; X64: # %bb.0:
-; X64-NEXT: vmovsh (%rdi), %xmm0 # encoding: [0x62,0xf5,0x7e,0x08,0x10,0x07]
-; X64-NEXT: vmovsh (%rsi), %xmm1 # encoding: [0x62,0xf5,0x7e,0x08,0x10,0x0e]
+; X64-NEXT: vmovsh {{.*#+}} xmm0 = mem[0],zero,zero,zero,zero,zero,zero,zero
+; X64-NEXT: # encoding: [0x62,0xf5,0x7e,0x08,0x10,0x07]
+; X64-NEXT: vmovsh {{.*#+}} xmm1 = mem[0],zero,zero,zero,zero,zero,zero,zero
+; X64-NEXT: # encoding: [0x62,0xf5,0x7e,0x08,0x10,0x0e]
; X64-NEXT: vfmadd213sh %xmm0, %xmm0, %xmm1 # encoding: [0x62,0xf6,0x7d,0x08,0xa9,0xc8]
; X64-NEXT: kmovd %edx, %k1 # encoding: [0xc5,0xfb,0x92,0xca]
; X64-NEXT: vmovsh %xmm1, %xmm0, %xmm0 {%k1} # encoding: [0x62,0xf5,0x7e,0x09,0x10,0xc1]
diff --git a/llvm/test/CodeGen/X86/avx512fp16-mov.ll b/llvm/test/CodeGen/X86/avx512fp16-mov.ll
index 7aebc1b..f4eb5b9 100644
--- a/llvm/test/CodeGen/X86/avx512fp16-mov.ll
+++ b/llvm/test/CodeGen/X86/avx512fp16-mov.ll
@@ -178,7 +178,7 @@ define void @test5(half %x, ptr %y) {
;
; X86-LABEL: test5:
; X86: # %bb.0:
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm0
+; X86-NEXT: vmovsh {{.*#+}} xmm0 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: vmovsh %xmm0, (%eax)
; X86-NEXT: retl
@@ -189,13 +189,13 @@ define void @test5(half %x, ptr %y) {
define half @test7(ptr %x) {
; X64-LABEL: test7:
; X64: # %bb.0:
-; X64-NEXT: vmovsh (%rdi), %xmm0
+; X64-NEXT: vmovsh {{.*#+}} xmm0 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X64-NEXT: retq
;
; X86-LABEL: test7:
; X86: # %bb.0:
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
-; X86-NEXT: vmovsh (%eax), %xmm0
+; X86-NEXT: vmovsh {{.*#+}} xmm0 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X86-NEXT: retl
%y = load i16, ptr %x
%res = bitcast i16 %y to half
@@ -253,13 +253,13 @@ define <32 x i16> @test10c(ptr %x) {
define <8 x half> @test11(ptr %x) {
; X64-LABEL: test11:
; X64: # %bb.0:
-; X64-NEXT: vmovsh (%rdi), %xmm0
+; X64-NEXT: vmovsh {{.*#+}} xmm0 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X64-NEXT: retq
;
; X86-LABEL: test11:
; X86: # %bb.0:
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
-; X86-NEXT: vmovsh (%eax), %xmm0
+; X86-NEXT: vmovsh {{.*#+}} xmm0 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X86-NEXT: retl
%y = load half, ptr %x, align 2
%res = insertelement <8 x half>zeroinitializer, half %y, i32 0
@@ -269,13 +269,13 @@ define <8 x half> @test11(ptr %x) {
define <16 x half> @test11b(ptr %x) {
; X64-LABEL: test11b:
; X64: # %bb.0:
-; X64-NEXT: vmovsh (%rdi), %xmm0
+; X64-NEXT: vmovsh {{.*#+}} xmm0 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X64-NEXT: retq
;
; X86-LABEL: test11b:
; X86: # %bb.0:
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
-; X86-NEXT: vmovsh (%eax), %xmm0
+; X86-NEXT: vmovsh {{.*#+}} xmm0 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X86-NEXT: retl
%y = load half, ptr %x, align 2
%res = insertelement <16 x half>zeroinitializer, half %y, i32 0
@@ -285,13 +285,13 @@ define <16 x half> @test11b(ptr %x) {
define <32 x half> @test11c(ptr %x) {
; X64-LABEL: test11c:
; X64: # %bb.0:
-; X64-NEXT: vmovsh (%rdi), %xmm0
+; X64-NEXT: vmovsh {{.*#+}} xmm0 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X64-NEXT: retq
;
; X86-LABEL: test11c:
; X86: # %bb.0:
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
-; X86-NEXT: vmovsh (%eax), %xmm0
+; X86-NEXT: vmovsh {{.*#+}} xmm0 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X86-NEXT: retl
%y = load half, ptr %x, align 2
%res = insertelement <32 x half>zeroinitializer, half %y, i32 0
@@ -307,7 +307,7 @@ define <8 x half> @test14(half %x) {
;
; X86-LABEL: test14:
; X86: # %bb.0:
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm0
+; X86-NEXT: vmovsh {{.*#+}} xmm0 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X86-NEXT: retl
%res = insertelement <8 x half>zeroinitializer, half %x, i32 0
ret <8 x half>%res
@@ -322,7 +322,7 @@ define <16 x half> @test14b(half %x) {
;
; X86-LABEL: test14b:
; X86: # %bb.0:
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm0
+; X86-NEXT: vmovsh {{.*#+}} xmm0 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X86-NEXT: retl
%res = insertelement <16 x half>zeroinitializer, half %x, i32 0
ret <16 x half>%res
@@ -337,7 +337,7 @@ define <32 x half> @test14c(half %x) {
;
; X86-LABEL: test14c:
; X86: # %bb.0:
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm0
+; X86-NEXT: vmovsh {{.*#+}} xmm0 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X86-NEXT: retl
%res = insertelement <32 x half>zeroinitializer, half %x, i32 0
ret <32 x half>%res
@@ -1253,7 +1253,7 @@ define half @test_movw2(i16 %x) {
;
; X86-LABEL: test_movw2:
; X86: # %bb.0:
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm0
+; X86-NEXT: vmovsh {{.*#+}} xmm0 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X86-NEXT: retl
%res = bitcast i16 %x to half
ret half %res
@@ -1358,7 +1358,7 @@ define half @extract_f16_8(<32 x half> %x, i64 %idx) nounwind {
; X64-NEXT: subq $128, %rsp
; X64-NEXT: andl $31, %edi
; X64-NEXT: vmovaps %zmm0, (%rsp)
-; X64-NEXT: vmovsh (%rsp,%rdi,2), %xmm0
+; X64-NEXT: vmovsh {{.*#+}} xmm0 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X64-NEXT: movq %rbp, %rsp
; X64-NEXT: popq %rbp
; X64-NEXT: vzeroupper
@@ -1373,7 +1373,7 @@ define half @extract_f16_8(<32 x half> %x, i64 %idx) nounwind {
; X86-NEXT: movl 8(%ebp), %eax
; X86-NEXT: andl $31, %eax
; X86-NEXT: vmovaps %zmm0, (%esp)
-; X86-NEXT: vmovsh (%esp,%eax,2), %xmm0
+; X86-NEXT: vmovsh {{.*#+}} xmm0 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X86-NEXT: movl %ebp, %esp
; X86-NEXT: popl %ebp
; X86-NEXT: vzeroupper
@@ -1392,7 +1392,7 @@ define half @extract_f16_9(<64 x half> %x, i64 %idx) nounwind {
; X64-NEXT: andl $63, %edi
; X64-NEXT: vmovaps %zmm1, {{[0-9]+}}(%rsp)
; X64-NEXT: vmovaps %zmm0, (%rsp)
-; X64-NEXT: vmovsh (%rsp,%rdi,2), %xmm0
+; X64-NEXT: vmovsh {{.*#+}} xmm0 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X64-NEXT: movq %rbp, %rsp
; X64-NEXT: popq %rbp
; X64-NEXT: vzeroupper
@@ -1408,7 +1408,7 @@ define half @extract_f16_9(<64 x half> %x, i64 %idx) nounwind {
; X86-NEXT: andl $63, %eax
; X86-NEXT: vmovaps %zmm1, {{[0-9]+}}(%esp)
; X86-NEXT: vmovaps %zmm0, (%esp)
-; X86-NEXT: vmovsh (%esp,%eax,2), %xmm0
+; X86-NEXT: vmovsh {{.*#+}} xmm0 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X86-NEXT: movl %ebp, %esp
; X86-NEXT: popl %ebp
; X86-NEXT: vzeroupper
@@ -1797,11 +1797,11 @@ define <8 x half> @build_vector_xxxxuuuu(half %a0, half %a1, half %a2, half %a3)
;
; X86-LABEL: build_vector_xxxxuuuu:
; X86: # %bb.0:
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm0
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm1
+; X86-NEXT: vmovsh {{.*#+}} xmm0 = mem[0],zero,zero,zero,zero,zero,zero,zero
+; X86-NEXT: vmovsh {{.*#+}} xmm1 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X86-NEXT: vpunpcklwd {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm1
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm2
+; X86-NEXT: vmovsh {{.*#+}} xmm1 = mem[0],zero,zero,zero,zero,zero,zero,zero
+; X86-NEXT: vmovsh {{.*#+}} xmm2 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X86-NEXT: vpunpcklwd {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3]
; X86-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0],xmm1[0],zero,zero
; X86-NEXT: retl
@@ -1823,11 +1823,11 @@ define <8 x half> @build_vector_uuuuxxxx(half %a0, half %a1, half %a2, half %a3)
;
; X86-LABEL: build_vector_uuuuxxxx:
; X86: # %bb.0:
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm0
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm1
+; X86-NEXT: vmovsh {{.*#+}} xmm0 = mem[0],zero,zero,zero,zero,zero,zero,zero
+; X86-NEXT: vmovsh {{.*#+}} xmm1 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X86-NEXT: vpunpcklwd {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm1
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm2
+; X86-NEXT: vmovsh {{.*#+}} xmm1 = mem[0],zero,zero,zero,zero,zero,zero,zero
+; X86-NEXT: vmovsh {{.*#+}} xmm2 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X86-NEXT: vpunpcklwd {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3]
; X86-NEXT: vpunpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
; X86-NEXT: vpbroadcastq %xmm0, %xmm0
@@ -1853,18 +1853,18 @@ define <8 x half> @build_vector_xxxxxxxx(half %a0, half %a1, half %a2, half %a3,
;
; X86-LABEL: build_vector_xxxxxxxx:
; X86: # %bb.0:
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm0
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm1
+; X86-NEXT: vmovsh {{.*#+}} xmm0 = mem[0],zero,zero,zero,zero,zero,zero,zero
+; X86-NEXT: vmovsh {{.*#+}} xmm1 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X86-NEXT: vpunpcklwd {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm1
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm2
+; X86-NEXT: vmovsh {{.*#+}} xmm1 = mem[0],zero,zero,zero,zero,zero,zero,zero
+; X86-NEXT: vmovsh {{.*#+}} xmm2 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X86-NEXT: vpunpcklwd {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3]
; X86-NEXT: vpunpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm1
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm2
+; X86-NEXT: vmovsh {{.*#+}} xmm1 = mem[0],zero,zero,zero,zero,zero,zero,zero
+; X86-NEXT: vmovsh {{.*#+}} xmm2 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X86-NEXT: vpunpcklwd {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3]
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm2
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm3
+; X86-NEXT: vmovsh {{.*#+}} xmm2 = mem[0],zero,zero,zero,zero,zero,zero,zero
+; X86-NEXT: vmovsh {{.*#+}} xmm3 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X86-NEXT: vpunpcklwd {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1],xmm2[2],xmm3[2],xmm2[3],xmm3[3]
; X86-NEXT: vpunpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
; X86-NEXT: vpunpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
@@ -1895,18 +1895,18 @@ define <16 x half> @build_vector_xxxxuuuuuuuuxxxx(half %a0, half %a1, half %a2,
;
; X86-LABEL: build_vector_xxxxuuuuuuuuxxxx:
; X86: # %bb.0:
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm0
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm1
+; X86-NEXT: vmovsh {{.*#+}} xmm0 = mem[0],zero,zero,zero,zero,zero,zero,zero
+; X86-NEXT: vmovsh {{.*#+}} xmm1 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X86-NEXT: vpunpcklwd {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm1
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm2
+; X86-NEXT: vmovsh {{.*#+}} xmm1 = mem[0],zero,zero,zero,zero,zero,zero,zero
+; X86-NEXT: vmovsh {{.*#+}} xmm2 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X86-NEXT: vpunpcklwd {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3]
; X86-NEXT: vpunpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm1
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm2
+; X86-NEXT: vmovsh {{.*#+}} xmm1 = mem[0],zero,zero,zero,zero,zero,zero,zero
+; X86-NEXT: vmovsh {{.*#+}} xmm2 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X86-NEXT: vpunpcklwd {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3]
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm2
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm3
+; X86-NEXT: vmovsh {{.*#+}} xmm2 = mem[0],zero,zero,zero,zero,zero,zero,zero
+; X86-NEXT: vmovsh {{.*#+}} xmm3 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X86-NEXT: vpunpcklwd {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1],xmm2[2],xmm3[2],xmm2[3],xmm3[3]
; X86-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0],xmm2[0],zero,zero
; X86-NEXT: vpbroadcastq %xmm0, %xmm0
@@ -2006,10 +2006,10 @@ define <8 x half> @test21(half %a, half %b, half %c) nounwind {
;
; X86-LABEL: test21:
; X86: # %bb.0:
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm0
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm1
+; X86-NEXT: vmovsh {{.*#+}} xmm0 = mem[0],zero,zero,zero,zero,zero,zero,zero
+; X86-NEXT: vmovsh {{.*#+}} xmm1 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X86-NEXT: vpunpcklwd {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
-; X86-NEXT: vmovsh {{[0-9]+}}(%esp), %xmm1
+; X86-NEXT: vmovsh {{.*#+}} xmm1 = mem[0],zero,zero,zero,zero,zero,zero,zero
; X86-NEXT: vpunpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
; X86-NEXT: vpxor %xmm1, %xmm1, %xmm1
; X86-NEXT: vpbroadcastw %xmm1, %xmm1
diff --git a/llvm/test/CodeGen/X86/stack-folding-fp-avx512fp16.ll b/llvm/test/CodeGen/X86/stack-folding-fp-avx512fp16.ll
index f6863be..e4eca6b 100644
--- a/llvm/test/CodeGen/X86/stack-folding-fp-avx512fp16.ll
+++ b/llvm/test/CodeGen/X86/stack-folding-fp-avx512fp16.ll
@@ -727,6 +727,7 @@ define half @stack_fold_maxsh_commuted(half %a0, half %a1) #0 {
; CHECK-NEXT: nop
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: vmovsh {{[-0-9]+}}(%r{{[sb]}}p), %xmm1 # 4-byte Reload
+; CHECK-NEXT: # xmm1 = mem[0],zero,zero,zero,zero,zero,zero,zero
; CHECK-NEXT: vmaxsh %xmm0, %xmm1, %xmm0
; CHECK-NEXT: retq
%1 = tail call <2 x i64> asm sideeffect "nop", "=x,~{xmm2},~{xmm3},~{xmm4},~{xmm5},~{xmm6},~{xmm7},~{xmm8},~{xmm9},~{xmm10},~{xmm11},~{xmm12},~{xmm13},~{xmm14},~{xmm15},~{xmm16},~{xmm17},~{xmm18},~{xmm19},~{xmm20},~{xmm21},~{xmm22},~{xmm23},~{xmm24},~{xmm25},~{xmm26},~{xmm27},~{xmm28},~{xmm29},~{xmm30},~{xmm31},~{flags}"()
@@ -1044,6 +1045,7 @@ define half @stack_fold_minsh_commuted(half %a0, half %a1) #0 {
; CHECK-NEXT: nop
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: vmovsh {{[-0-9]+}}(%r{{[sb]}}p), %xmm1 # 4-byte Reload
+; CHECK-NEXT: # xmm1 = mem[0],zero,zero,zero,zero,zero,zero,zero
; CHECK-NEXT: vminsh %xmm0, %xmm1, %xmm0
; CHECK-NEXT: retq
%1 = tail call <2 x i64> asm sideeffect "nop", "=x,~{xmm2},~{xmm3},~{xmm4},~{xmm5},~{xmm6},~{xmm7},~{xmm8},~{xmm9},~{xmm10},~{xmm11},~{xmm12},~{xmm13},~{xmm14},~{xmm15},~{xmm16},~{xmm17},~{xmm18},~{xmm19},~{xmm20},~{xmm21},~{xmm22},~{xmm23},~{xmm24},~{xmm25},~{xmm26},~{xmm27},~{xmm28},~{xmm29},~{xmm30},~{xmm31},~{flags}"()