[llvm] 66caf01 - [InstCombine][X86] Add commuted undef arg tests for PMADDWD/PMADDUBSW intrinsics
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 28 03:49:45 PDT 2024
Author: Simon Pilgrim
Date: 2024-06-28T11:49:08+01:00
New Revision: 66caf01dbf17b3430a1e2b148fc4660bc58a5f78
URL: https://github.com/llvm/llvm-project/commit/66caf01dbf17b3430a1e2b148fc4660bc58a5f78
DIFF: https://github.com/llvm/llvm-project/commit/66caf01dbf17b3430a1e2b148fc4660bc58a5f78.diff
LOG: [InstCombine][X86] Add commuted undef arg tests for PMADDWD/PMADDUBSW intrinsics
Added:
Modified:
llvm/test/Transforms/InstCombine/X86/x86-pmaddubsw.ll
llvm/test/Transforms/InstCombine/X86/x86-pmaddwd.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstCombine/X86/x86-pmaddubsw.ll b/llvm/test/Transforms/InstCombine/X86/x86-pmaddubsw.ll
index 4f5b58f79a29c..967664ca5a61c 100644
--- a/llvm/test/Transforms/InstCombine/X86/x86-pmaddubsw.ll
+++ b/llvm/test/Transforms/InstCombine/X86/x86-pmaddubsw.ll
@@ -5,30 +5,57 @@
; UNDEF Elts
;
-define <8 x i16> @undef_pmaddubsw_128() {
+define <8 x i16> @undef_pmaddubsw_128(<16 x i8> %a0) {
; CHECK-LABEL: @undef_pmaddubsw_128(
-; CHECK-NEXT: [[TMP1:%.*]] = call <8 x i16> @llvm.x86.ssse3.pmadd.ub.sw.128(<16 x i8> undef, <16 x i8> undef)
+; CHECK-NEXT: [[TMP1:%.*]] = call <8 x i16> @llvm.x86.ssse3.pmadd.ub.sw.128(<16 x i8> [[A0:%.*]], <16 x i8> undef)
; CHECK-NEXT: ret <8 x i16> [[TMP1]]
;
- %1 = call <8 x i16> @llvm.x86.ssse3.pmadd.ub.sw.128(<16 x i8> undef, <16 x i8> undef)
+ %1 = call <8 x i16> @llvm.x86.ssse3.pmadd.ub.sw.128(<16 x i8> %a0, <16 x i8> undef)
ret <8 x i16> %1
}
-define <16 x i16> @undef_pmaddubsw_256() {
+define <8 x i16> @undef_pmaddubsw_128_commute(<16 x i8> %a0) {
+; CHECK-LABEL: @undef_pmaddubsw_128_commute(
+; CHECK-NEXT: [[TMP1:%.*]] = call <8 x i16> @llvm.x86.ssse3.pmadd.ub.sw.128(<16 x i8> undef, <16 x i8> [[A0:%.*]])
+; CHECK-NEXT: ret <8 x i16> [[TMP1]]
+;
+ %1 = call <8 x i16> @llvm.x86.ssse3.pmadd.ub.sw.128(<16 x i8> undef, <16 x i8> %a0)
+ ret <8 x i16> %1
+}
+
+define <16 x i16> @undef_pmaddubsw_256(<32 x i8> %a0) {
; CHECK-LABEL: @undef_pmaddubsw_256(
-; CHECK-NEXT: [[TMP1:%.*]] = call <16 x i16> @llvm.x86.avx2.pmadd.ub.sw(<32 x i8> undef, <32 x i8> undef)
+; CHECK-NEXT: [[TMP1:%.*]] = call <16 x i16> @llvm.x86.avx2.pmadd.ub.sw(<32 x i8> [[A0:%.*]], <32 x i8> undef)
; CHECK-NEXT: ret <16 x i16> [[TMP1]]
;
- %1 = call <16 x i16> @llvm.x86.avx2.pmadd.ub.sw(<32 x i8> undef, <32 x i8> undef)
+ %1 = call <16 x i16> @llvm.x86.avx2.pmadd.ub.sw(<32 x i8> %a0, <32 x i8> undef)
ret <16 x i16> %1
}
-define <32 x i16> @undef_pmaddubsw_512() {
+define <16 x i16> @undef_pmaddubsw_256_commute(<32 x i8> %a0) {
+; CHECK-LABEL: @undef_pmaddubsw_256_commute(
+; CHECK-NEXT: [[TMP1:%.*]] = call <16 x i16> @llvm.x86.avx2.pmadd.ub.sw(<32 x i8> undef, <32 x i8> [[A0:%.*]])
+; CHECK-NEXT: ret <16 x i16> [[TMP1]]
+;
+ %1 = call <16 x i16> @llvm.x86.avx2.pmadd.ub.sw(<32 x i8> undef, <32 x i8> %a0)
+ ret <16 x i16> %1
+}
+
+define <32 x i16> @undef_pmaddubsw_512(<64 x i8> %a0) {
; CHECK-LABEL: @undef_pmaddubsw_512(
-; CHECK-NEXT: [[TMP1:%.*]] = call <32 x i16> @llvm.x86.avx512.pmaddubs.w.512(<64 x i8> undef, <64 x i8> undef)
+; CHECK-NEXT: [[TMP1:%.*]] = call <32 x i16> @llvm.x86.avx512.pmaddubs.w.512(<64 x i8> [[A0:%.*]], <64 x i8> undef)
+; CHECK-NEXT: ret <32 x i16> [[TMP1]]
+;
+ %1 = call <32 x i16> @llvm.x86.avx512.pmaddubs.w.512(<64 x i8> %a0, <64 x i8> undef)
+ ret <32 x i16> %1
+}
+
+define <32 x i16> @undef_pmaddubsw_512_commute(<64 x i8> %a0) {
+; CHECK-LABEL: @undef_pmaddubsw_512_commute(
+; CHECK-NEXT: [[TMP1:%.*]] = call <32 x i16> @llvm.x86.avx512.pmaddubs.w.512(<64 x i8> undef, <64 x i8> [[A0:%.*]])
; CHECK-NEXT: ret <32 x i16> [[TMP1]]
;
- %1 = call <32 x i16> @llvm.x86.avx512.pmaddubs.w.512(<64 x i8> undef, <64 x i8> undef)
+ %1 = call <32 x i16> @llvm.x86.avx512.pmaddubs.w.512(<64 x i8> undef, <64 x i8> %a0)
ret <32 x i16> %1
}
diff --git a/llvm/test/Transforms/InstCombine/X86/x86-pmaddwd.ll b/llvm/test/Transforms/InstCombine/X86/x86-pmaddwd.ll
index b91670e906be5..ad7b20ba6141b 100644
--- a/llvm/test/Transforms/InstCombine/X86/x86-pmaddwd.ll
+++ b/llvm/test/Transforms/InstCombine/X86/x86-pmaddwd.ll
@@ -5,30 +5,57 @@
; UNDEF Elts
;
-define <4 x i32> @undef_pmaddwd_128() {
+define <4 x i32> @undef_pmaddwd_128(<8 x i16> %a0) {
; CHECK-LABEL: @undef_pmaddwd_128(
-; CHECK-NEXT: [[TMP1:%.*]] = call <4 x i32> @llvm.x86.sse2.pmadd.wd(<8 x i16> undef, <8 x i16> undef)
+; CHECK-NEXT: [[TMP1:%.*]] = call <4 x i32> @llvm.x86.sse2.pmadd.wd(<8 x i16> [[A0:%.*]], <8 x i16> undef)
; CHECK-NEXT: ret <4 x i32> [[TMP1]]
;
- %1 = call <4 x i32> @llvm.x86.sse2.pmadd.wd(<8 x i16> undef, <8 x i16> undef)
+ %1 = call <4 x i32> @llvm.x86.sse2.pmadd.wd(<8 x i16> %a0, <8 x i16> undef)
ret <4 x i32> %1
}
-define <8 x i32> @undef_pmaddwd_256() {
+define <4 x i32> @undef_pmaddwd_128_commute(<8 x i16> %a0) {
+; CHECK-LABEL: @undef_pmaddwd_128_commute(
+; CHECK-NEXT: [[TMP1:%.*]] = call <4 x i32> @llvm.x86.sse2.pmadd.wd(<8 x i16> undef, <8 x i16> [[A0:%.*]])
+; CHECK-NEXT: ret <4 x i32> [[TMP1]]
+;
+ %1 = call <4 x i32> @llvm.x86.sse2.pmadd.wd(<8 x i16> undef, <8 x i16> %a0)
+ ret <4 x i32> %1
+}
+
+define <8 x i32> @undef_pmaddwd_256(<16 x i16> %a0) {
; CHECK-LABEL: @undef_pmaddwd_256(
-; CHECK-NEXT: [[TMP1:%.*]] = call <8 x i32> @llvm.x86.avx2.pmadd.wd(<16 x i16> undef, <16 x i16> undef)
+; CHECK-NEXT: [[TMP1:%.*]] = call <8 x i32> @llvm.x86.avx2.pmadd.wd(<16 x i16> [[A0:%.*]], <16 x i16> undef)
; CHECK-NEXT: ret <8 x i32> [[TMP1]]
;
- %1 = call <8 x i32> @llvm.x86.avx2.pmadd.wd(<16 x i16> undef, <16 x i16> undef)
+ %1 = call <8 x i32> @llvm.x86.avx2.pmadd.wd(<16 x i16> %a0, <16 x i16> undef)
ret <8 x i32> %1
}
-define <16 x i32> @undef_pmaddwd_512() {
+define <8 x i32> @undef_pmaddwd_256_commute(<16 x i16> %a0) {
+; CHECK-LABEL: @undef_pmaddwd_256_commute(
+; CHECK-NEXT: [[TMP1:%.*]] = call <8 x i32> @llvm.x86.avx2.pmadd.wd(<16 x i16> undef, <16 x i16> [[A0:%.*]])
+; CHECK-NEXT: ret <8 x i32> [[TMP1]]
+;
+ %1 = call <8 x i32> @llvm.x86.avx2.pmadd.wd(<16 x i16> undef, <16 x i16> %a0)
+ ret <8 x i32> %1
+}
+
+define <16 x i32> @undef_pmaddwd_512(<32 x i16> %a0) {
; CHECK-LABEL: @undef_pmaddwd_512(
-; CHECK-NEXT: [[TMP1:%.*]] = call <16 x i32> @llvm.x86.avx512.pmaddw.d.512(<32 x i16> undef, <32 x i16> undef)
+; CHECK-NEXT: [[TMP1:%.*]] = call <16 x i32> @llvm.x86.avx512.pmaddw.d.512(<32 x i16> [[A0:%.*]], <32 x i16> undef)
+; CHECK-NEXT: ret <16 x i32> [[TMP1]]
+;
+ %1 = call <16 x i32> @llvm.x86.avx512.pmaddw.d.512(<32 x i16> %a0, <32 x i16> undef)
+ ret <16 x i32> %1
+}
+
+define <16 x i32> @undef_pmaddwd_512_commute(<32 x i16> %a0) {
+; CHECK-LABEL: @undef_pmaddwd_512_commute(
+; CHECK-NEXT: [[TMP1:%.*]] = call <16 x i32> @llvm.x86.avx512.pmaddw.d.512(<32 x i16> undef, <32 x i16> [[A0:%.*]])
; CHECK-NEXT: ret <16 x i32> [[TMP1]]
;
- %1 = call <16 x i32> @llvm.x86.avx512.pmaddw.d.512(<32 x i16> undef, <32 x i16> undef)
+ %1 = call <16 x i32> @llvm.x86.avx512.pmaddw.d.512(<32 x i16> undef, <32 x i16> %a0)
ret <16 x i32> %1
}
More information about the llvm-commits
mailing list