[llvm] 4ee4bc3 - [InstCombine][X86] Add zero/undef arg handling for MULH/PMULHU/PMULHRS intrinsics
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 3 05:46:38 PDT 2024
Author: Simon Pilgrim
Date: 2024-07-03T13:44:39+01:00
New Revision: 4ee4bc3cf259419c3d87711df1f96742a0914a0c
URL: https://github.com/llvm/llvm-project/commit/4ee4bc3cf259419c3d87711df1f96742a0914a0c
DIFF: https://github.com/llvm/llvm-project/commit/4ee4bc3cf259419c3d87711df1f96742a0914a0c.diff
LOG: [InstCombine][X86] Add zero/undef arg handling for MULH/PMULHU/PMULHRS intrinsics
Added:
Modified:
llvm/lib/Target/X86/X86InstCombineIntrinsic.cpp
llvm/test/Transforms/InstCombine/X86/x86-pmulh.ll
llvm/test/Transforms/InstCombine/X86/x86-pmulhrs.ll
llvm/test/Transforms/InstCombine/X86/x86-pmulhu.ll
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86InstCombineIntrinsic.cpp b/llvm/lib/Target/X86/X86InstCombineIntrinsic.cpp
index fcf7ad73074c4..7ac149852be97 100644
--- a/llvm/lib/Target/X86/X86InstCombineIntrinsic.cpp
+++ b/llvm/lib/Target/X86/X86InstCombineIntrinsic.cpp
@@ -502,6 +502,27 @@ static Value *simplifyX86pack(IntrinsicInst &II,
return Builder.CreateTrunc(Shuffle, ResTy);
}
+static Value *simplifyX86pmulh(IntrinsicInst &II,
+ InstCombiner::BuilderTy &Builder) {
+ Value *Arg0 = II.getArgOperand(0);
+ Value *Arg1 = II.getArgOperand(1);
+ auto *ResTy = cast<FixedVectorType>(II.getType());
+ [[maybe_unused]] auto *ArgTy = cast<FixedVectorType>(Arg0->getType());
+ assert(ArgTy == ResTy && ResTy->getScalarSizeInBits() == 16 &&
+ "Unexpected PMULH types");
+
+ // Multiply by undef -> zero (NOT undef!) as other arg could still be zero.
+ if (isa<UndefValue>(Arg0) || isa<UndefValue>(Arg1))
+ return ConstantAggregateZero::get(ResTy);
+
+ // Multiply by zero.
+ if (isa<ConstantAggregateZero>(Arg0) || isa<ConstantAggregateZero>(Arg1))
+ return ConstantAggregateZero::get(ResTy);
+
+ // TODO: Constant folding.
+ return nullptr;
+}
+
static Value *simplifyX86pmadd(IntrinsicInst &II,
InstCombiner::BuilderTy &Builder,
bool IsPMADDWD) {
@@ -2568,6 +2589,20 @@ X86TTIImpl::instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const {
}
break;
+ case Intrinsic::x86_sse2_pmulh_w:
+ case Intrinsic::x86_avx2_pmulh_w:
+ case Intrinsic::x86_avx512_pmulh_w_512:
+ case Intrinsic::x86_sse2_pmulhu_w:
+ case Intrinsic::x86_avx2_pmulhu_w:
+ case Intrinsic::x86_avx512_pmulhu_w_512:
+ case Intrinsic::x86_ssse3_pmul_hr_sw_128:
+ case Intrinsic::x86_avx2_pmul_hr_sw:
+ case Intrinsic::x86_avx512_pmul_hr_sw_512:
+ if (Value *V = simplifyX86pmulh(II, IC.Builder)) {
+ return IC.replaceInstUsesWith(II, V);
+ }
+ break;
+
case Intrinsic::x86_sse2_pmadd_wd:
case Intrinsic::x86_avx2_pmadd_wd:
case Intrinsic::x86_avx512_pmaddw_d_512:
diff --git a/llvm/test/Transforms/InstCombine/X86/x86-pmulh.ll b/llvm/test/Transforms/InstCombine/X86/x86-pmulh.ll
index 130dd7b33d8a4..d6a06e7d08358 100644
--- a/llvm/test/Transforms/InstCombine/X86/x86-pmulh.ll
+++ b/llvm/test/Transforms/InstCombine/X86/x86-pmulh.ll
@@ -7,8 +7,7 @@
define <8 x i16> @undef_pmulh_128(<8 x i16> %a0) {
; CHECK-LABEL: @undef_pmulh_128(
-; CHECK-NEXT: [[TMP1:%.*]] = call <8 x i16> @llvm.x86.sse2.pmulh.w(<8 x i16> [[A0:%.*]], <8 x i16> undef)
-; CHECK-NEXT: ret <8 x i16> [[TMP1]]
+; CHECK-NEXT: ret <8 x i16> zeroinitializer
;
%1 = call <8 x i16> @llvm.x86.sse2.pmulh.w(<8 x i16> %a0, <8 x i16> undef)
ret <8 x i16> %1
@@ -16,8 +15,7 @@ define <8 x i16> @undef_pmulh_128(<8 x i16> %a0) {
define <8 x i16> @undef_pmulh_128_commute(<8 x i16> %a0) {
; CHECK-LABEL: @undef_pmulh_128_commute(
-; CHECK-NEXT: [[TMP1:%.*]] = call <8 x i16> @llvm.x86.sse2.pmulh.w(<8 x i16> undef, <8 x i16> [[A0:%.*]])
-; CHECK-NEXT: ret <8 x i16> [[TMP1]]
+; CHECK-NEXT: ret <8 x i16> zeroinitializer
;
%1 = call <8 x i16> @llvm.x86.sse2.pmulh.w(<8 x i16> undef, <8 x i16> %a0)
ret <8 x i16> %1
@@ -25,8 +23,7 @@ define <8 x i16> @undef_pmulh_128_commute(<8 x i16> %a0) {
define <16 x i16> @undef_pmulh_256(<16 x i16> %a0) {
; CHECK-LABEL: @undef_pmulh_256(
-; CHECK-NEXT: [[TMP1:%.*]] = call <16 x i16> @llvm.x86.avx2.pmulh.w(<16 x i16> [[A0:%.*]], <16 x i16> undef)
-; CHECK-NEXT: ret <16 x i16> [[TMP1]]
+; CHECK-NEXT: ret <16 x i16> zeroinitializer
;
%1 = call <16 x i16> @llvm.x86.avx2.pmulh.w(<16 x i16> %a0, <16 x i16> undef)
ret <16 x i16> %1
@@ -34,8 +31,7 @@ define <16 x i16> @undef_pmulh_256(<16 x i16> %a0) {
define <16 x i16> @undef_pmulh_256_commute(<16 x i16> %a0) {
; CHECK-LABEL: @undef_pmulh_256_commute(
-; CHECK-NEXT: [[TMP1:%.*]] = call <16 x i16> @llvm.x86.avx2.pmulh.w(<16 x i16> undef, <16 x i16> [[A0:%.*]])
-; CHECK-NEXT: ret <16 x i16> [[TMP1]]
+; CHECK-NEXT: ret <16 x i16> zeroinitializer
;
%1 = call <16 x i16> @llvm.x86.avx2.pmulh.w(<16 x i16> undef, <16 x i16> %a0)
ret <16 x i16> %1
@@ -43,8 +39,7 @@ define <16 x i16> @undef_pmulh_256_commute(<16 x i16> %a0) {
define <32 x i16> @undef_pmulh_512(<32 x i16> %a0) {
; CHECK-LABEL: @undef_pmulh_512(
-; CHECK-NEXT: [[TMP1:%.*]] = call <32 x i16> @llvm.x86.avx512.pmulh.w.512(<32 x i16> [[A0:%.*]], <32 x i16> undef)
-; CHECK-NEXT: ret <32 x i16> [[TMP1]]
+; CHECK-NEXT: ret <32 x i16> zeroinitializer
;
%1 = call <32 x i16> @llvm.x86.avx512.pmulh.w.512(<32 x i16> %a0, <32 x i16> undef)
ret <32 x i16> %1
@@ -52,8 +47,7 @@ define <32 x i16> @undef_pmulh_512(<32 x i16> %a0) {
define <32 x i16> @undef_pmulh_512_commute(<32 x i16> %a0) {
; CHECK-LABEL: @undef_pmulh_512_commute(
-; CHECK-NEXT: [[TMP1:%.*]] = call <32 x i16> @llvm.x86.avx512.pmulh.w.512(<32 x i16> undef, <32 x i16> [[A0:%.*]])
-; CHECK-NEXT: ret <32 x i16> [[TMP1]]
+; CHECK-NEXT: ret <32 x i16> zeroinitializer
;
%1 = call <32 x i16> @llvm.x86.avx512.pmulh.w.512(<32 x i16> undef, <32 x i16> %a0)
ret <32 x i16> %1
@@ -65,8 +59,7 @@ define <32 x i16> @undef_pmulh_512_commute(<32 x i16> %a0) {
define <8 x i16> @zero_pmulh_128(<8 x i16> %a0) {
; CHECK-LABEL: @zero_pmulh_128(
-; CHECK-NEXT: [[TMP1:%.*]] = call <8 x i16> @llvm.x86.sse2.pmulh.w(<8 x i16> [[A0:%.*]], <8 x i16> zeroinitializer)
-; CHECK-NEXT: ret <8 x i16> [[TMP1]]
+; CHECK-NEXT: ret <8 x i16> zeroinitializer
;
%1 = call <8 x i16> @llvm.x86.sse2.pmulh.w(<8 x i16> %a0, <8 x i16> zeroinitializer)
ret <8 x i16> %1
@@ -74,8 +67,7 @@ define <8 x i16> @zero_pmulh_128(<8 x i16> %a0) {
define <8 x i16> @zero_pmulh_128_commute(<8 x i16> %a0) {
; CHECK-LABEL: @zero_pmulh_128_commute(
-; CHECK-NEXT: [[TMP1:%.*]] = call <8 x i16> @llvm.x86.sse2.pmulh.w(<8 x i16> zeroinitializer, <8 x i16> [[A0:%.*]])
-; CHECK-NEXT: ret <8 x i16> [[TMP1]]
+; CHECK-NEXT: ret <8 x i16> zeroinitializer
;
%1 = call <8 x i16> @llvm.x86.sse2.pmulh.w(<8 x i16> zeroinitializer, <8 x i16> %a0)
ret <8 x i16> %1
@@ -83,8 +75,7 @@ define <8 x i16> @zero_pmulh_128_commute(<8 x i16> %a0) {
define <16 x i16> @zero_pmulh_256(<16 x i16> %a0) {
; CHECK-LABEL: @zero_pmulh_256(
-; CHECK-NEXT: [[TMP1:%.*]] = call <16 x i16> @llvm.x86.avx2.pmulh.w(<16 x i16> [[A0:%.*]], <16 x i16> zeroinitializer)
-; CHECK-NEXT: ret <16 x i16> [[TMP1]]
+; CHECK-NEXT: ret <16 x i16> zeroinitializer
;
%1 = call <16 x i16> @llvm.x86.avx2.pmulh.w(<16 x i16> %a0, <16 x i16> zeroinitializer)
ret <16 x i16> %1
@@ -92,8 +83,7 @@ define <16 x i16> @zero_pmulh_256(<16 x i16> %a0) {
define <16 x i16> @zero_pmulh_256_commute(<16 x i16> %a0) {
; CHECK-LABEL: @zero_pmulh_256_commute(
-; CHECK-NEXT: [[TMP1:%.*]] = call <16 x i16> @llvm.x86.avx2.pmulh.w(<16 x i16> zeroinitializer, <16 x i16> [[A0:%.*]])
-; CHECK-NEXT: ret <16 x i16> [[TMP1]]
+; CHECK-NEXT: ret <16 x i16> zeroinitializer
;
%1 = call <16 x i16> @llvm.x86.avx2.pmulh.w(<16 x i16> zeroinitializer, <16 x i16> %a0)
ret <16 x i16> %1
@@ -101,8 +91,7 @@ define <16 x i16> @zero_pmulh_256_commute(<16 x i16> %a0) {
define <32 x i16> @zero_pmulh_512(<32 x i16> %a0) {
; CHECK-LABEL: @zero_pmulh_512(
-; CHECK-NEXT: [[TMP1:%.*]] = call <32 x i16> @llvm.x86.avx512.pmulh.w.512(<32 x i16> [[A0:%.*]], <32 x i16> zeroinitializer)
-; CHECK-NEXT: ret <32 x i16> [[TMP1]]
+; CHECK-NEXT: ret <32 x i16> zeroinitializer
;
%1 = call <32 x i16> @llvm.x86.avx512.pmulh.w.512(<32 x i16> %a0, <32 x i16> zeroinitializer)
ret <32 x i16> %1
@@ -110,8 +99,7 @@ define <32 x i16> @zero_pmulh_512(<32 x i16> %a0) {
define <32 x i16> @zero_pmulh_512_commute(<32 x i16> %a0) {
; CHECK-LABEL: @zero_pmulh_512_commute(
-; CHECK-NEXT: [[TMP1:%.*]] = call <32 x i16> @llvm.x86.avx512.pmulh.w.512(<32 x i16> zeroinitializer, <32 x i16> [[A0:%.*]])
-; CHECK-NEXT: ret <32 x i16> [[TMP1]]
+; CHECK-NEXT: ret <32 x i16> zeroinitializer
;
%1 = call <32 x i16> @llvm.x86.avx512.pmulh.w.512(<32 x i16> zeroinitializer, <32 x i16> %a0)
ret <32 x i16> %1
diff --git a/llvm/test/Transforms/InstCombine/X86/x86-pmulhrs.ll b/llvm/test/Transforms/InstCombine/X86/x86-pmulhrs.ll
index d568a1c703526..2c42534cae8b1 100644
--- a/llvm/test/Transforms/InstCombine/X86/x86-pmulhrs.ll
+++ b/llvm/test/Transforms/InstCombine/X86/x86-pmulhrs.ll
@@ -7,8 +7,7 @@
define <8 x i16> @undef_pmulh_128(<8 x i16> %a0) {
; CHECK-LABEL: @undef_pmulh_128(
-; CHECK-NEXT: [[TMP1:%.*]] = call <8 x i16> @llvm.x86.ssse3.pmul.hr.sw.128(<8 x i16> [[A0:%.*]], <8 x i16> undef)
-; CHECK-NEXT: ret <8 x i16> [[TMP1]]
+; CHECK-NEXT: ret <8 x i16> zeroinitializer
;
%1 = call <8 x i16> @llvm.x86.ssse3.pmul.hr.sw.128(<8 x i16> %a0, <8 x i16> undef)
ret <8 x i16> %1
@@ -16,8 +15,7 @@ define <8 x i16> @undef_pmulh_128(<8 x i16> %a0) {
define <8 x i16> @undef_pmulh_128_commute(<8 x i16> %a0) {
; CHECK-LABEL: @undef_pmulh_128_commute(
-; CHECK-NEXT: [[TMP1:%.*]] = call <8 x i16> @llvm.x86.ssse3.pmul.hr.sw.128(<8 x i16> undef, <8 x i16> [[A0:%.*]])
-; CHECK-NEXT: ret <8 x i16> [[TMP1]]
+; CHECK-NEXT: ret <8 x i16> zeroinitializer
;
%1 = call <8 x i16> @llvm.x86.ssse3.pmul.hr.sw.128(<8 x i16> undef, <8 x i16> %a0)
ret <8 x i16> %1
@@ -25,8 +23,7 @@ define <8 x i16> @undef_pmulh_128_commute(<8 x i16> %a0) {
define <16 x i16> @undef_pmulh_256(<16 x i16> %a0) {
; CHECK-LABEL: @undef_pmulh_256(
-; CHECK-NEXT: [[TMP1:%.*]] = call <16 x i16> @llvm.x86.avx2.pmul.hr.sw(<16 x i16> [[A0:%.*]], <16 x i16> undef)
-; CHECK-NEXT: ret <16 x i16> [[TMP1]]
+; CHECK-NEXT: ret <16 x i16> zeroinitializer
;
%1 = call <16 x i16> @llvm.x86.avx2.pmul.hr.sw(<16 x i16> %a0, <16 x i16> undef)
ret <16 x i16> %1
@@ -34,8 +31,7 @@ define <16 x i16> @undef_pmulh_256(<16 x i16> %a0) {
define <16 x i16> @undef_pmulh_256_commute(<16 x i16> %a0) {
; CHECK-LABEL: @undef_pmulh_256_commute(
-; CHECK-NEXT: [[TMP1:%.*]] = call <16 x i16> @llvm.x86.avx2.pmul.hr.sw(<16 x i16> undef, <16 x i16> [[A0:%.*]])
-; CHECK-NEXT: ret <16 x i16> [[TMP1]]
+; CHECK-NEXT: ret <16 x i16> zeroinitializer
;
%1 = call <16 x i16> @llvm.x86.avx2.pmul.hr.sw(<16 x i16> undef, <16 x i16> %a0)
ret <16 x i16> %1
@@ -43,8 +39,7 @@ define <16 x i16> @undef_pmulh_256_commute(<16 x i16> %a0) {
define <32 x i16> @undef_pmulh_512(<32 x i16> %a0) {
; CHECK-LABEL: @undef_pmulh_512(
-; CHECK-NEXT: [[TMP1:%.*]] = call <32 x i16> @llvm.x86.avx512.pmul.hr.sw.512(<32 x i16> [[A0:%.*]], <32 x i16> undef)
-; CHECK-NEXT: ret <32 x i16> [[TMP1]]
+; CHECK-NEXT: ret <32 x i16> zeroinitializer
;
%1 = call <32 x i16> @llvm.x86.avx512.pmul.hr.sw.512(<32 x i16> %a0, <32 x i16> undef)
ret <32 x i16> %1
@@ -52,8 +47,7 @@ define <32 x i16> @undef_pmulh_512(<32 x i16> %a0) {
define <32 x i16> @undef_pmulh_512_commute(<32 x i16> %a0) {
; CHECK-LABEL: @undef_pmulh_512_commute(
-; CHECK-NEXT: [[TMP1:%.*]] = call <32 x i16> @llvm.x86.avx512.pmul.hr.sw.512(<32 x i16> undef, <32 x i16> [[A0:%.*]])
-; CHECK-NEXT: ret <32 x i16> [[TMP1]]
+; CHECK-NEXT: ret <32 x i16> zeroinitializer
;
%1 = call <32 x i16> @llvm.x86.avx512.pmul.hr.sw.512(<32 x i16> undef, <32 x i16> %a0)
ret <32 x i16> %1
@@ -65,8 +59,7 @@ define <32 x i16> @undef_pmulh_512_commute(<32 x i16> %a0) {
define <8 x i16> @zero_pmulh_128(<8 x i16> %a0) {
; CHECK-LABEL: @zero_pmulh_128(
-; CHECK-NEXT: [[TMP1:%.*]] = call <8 x i16> @llvm.x86.ssse3.pmul.hr.sw.128(<8 x i16> [[A0:%.*]], <8 x i16> zeroinitializer)
-; CHECK-NEXT: ret <8 x i16> [[TMP1]]
+; CHECK-NEXT: ret <8 x i16> zeroinitializer
;
%1 = call <8 x i16> @llvm.x86.ssse3.pmul.hr.sw.128(<8 x i16> %a0, <8 x i16> zeroinitializer)
ret <8 x i16> %1
@@ -74,8 +67,7 @@ define <8 x i16> @zero_pmulh_128(<8 x i16> %a0) {
define <8 x i16> @zero_pmulh_128_commute(<8 x i16> %a0) {
; CHECK-LABEL: @zero_pmulh_128_commute(
-; CHECK-NEXT: [[TMP1:%.*]] = call <8 x i16> @llvm.x86.ssse3.pmul.hr.sw.128(<8 x i16> zeroinitializer, <8 x i16> [[A0:%.*]])
-; CHECK-NEXT: ret <8 x i16> [[TMP1]]
+; CHECK-NEXT: ret <8 x i16> zeroinitializer
;
%1 = call <8 x i16> @llvm.x86.ssse3.pmul.hr.sw.128(<8 x i16> zeroinitializer, <8 x i16> %a0)
ret <8 x i16> %1
@@ -83,8 +75,7 @@ define <8 x i16> @zero_pmulh_128_commute(<8 x i16> %a0) {
define <16 x i16> @zero_pmulh_256(<16 x i16> %a0) {
; CHECK-LABEL: @zero_pmulh_256(
-; CHECK-NEXT: [[TMP1:%.*]] = call <16 x i16> @llvm.x86.avx2.pmul.hr.sw(<16 x i16> [[A0:%.*]], <16 x i16> zeroinitializer)
-; CHECK-NEXT: ret <16 x i16> [[TMP1]]
+; CHECK-NEXT: ret <16 x i16> zeroinitializer
;
%1 = call <16 x i16> @llvm.x86.avx2.pmul.hr.sw(<16 x i16> %a0, <16 x i16> zeroinitializer)
ret <16 x i16> %1
@@ -92,8 +83,7 @@ define <16 x i16> @zero_pmulh_256(<16 x i16> %a0) {
define <16 x i16> @zero_pmulh_256_commute(<16 x i16> %a0) {
; CHECK-LABEL: @zero_pmulh_256_commute(
-; CHECK-NEXT: [[TMP1:%.*]] = call <16 x i16> @llvm.x86.avx2.pmul.hr.sw(<16 x i16> zeroinitializer, <16 x i16> [[A0:%.*]])
-; CHECK-NEXT: ret <16 x i16> [[TMP1]]
+; CHECK-NEXT: ret <16 x i16> zeroinitializer
;
%1 = call <16 x i16> @llvm.x86.avx2.pmul.hr.sw(<16 x i16> zeroinitializer, <16 x i16> %a0)
ret <16 x i16> %1
@@ -101,8 +91,7 @@ define <16 x i16> @zero_pmulh_256_commute(<16 x i16> %a0) {
define <32 x i16> @zero_pmulh_512(<32 x i16> %a0) {
; CHECK-LABEL: @zero_pmulh_512(
-; CHECK-NEXT: [[TMP1:%.*]] = call <32 x i16> @llvm.x86.avx512.pmul.hr.sw.512(<32 x i16> [[A0:%.*]], <32 x i16> zeroinitializer)
-; CHECK-NEXT: ret <32 x i16> [[TMP1]]
+; CHECK-NEXT: ret <32 x i16> zeroinitializer
;
%1 = call <32 x i16> @llvm.x86.avx512.pmul.hr.sw.512(<32 x i16> %a0, <32 x i16> zeroinitializer)
ret <32 x i16> %1
@@ -110,8 +99,7 @@ define <32 x i16> @zero_pmulh_512(<32 x i16> %a0) {
define <32 x i16> @zero_pmulh_512_commute(<32 x i16> %a0) {
; CHECK-LABEL: @zero_pmulh_512_commute(
-; CHECK-NEXT: [[TMP1:%.*]] = call <32 x i16> @llvm.x86.avx512.pmul.hr.sw.512(<32 x i16> zeroinitializer, <32 x i16> [[A0:%.*]])
-; CHECK-NEXT: ret <32 x i16> [[TMP1]]
+; CHECK-NEXT: ret <32 x i16> zeroinitializer
;
%1 = call <32 x i16> @llvm.x86.avx512.pmul.hr.sw.512(<32 x i16> zeroinitializer, <32 x i16> %a0)
ret <32 x i16> %1
diff --git a/llvm/test/Transforms/InstCombine/X86/x86-pmulhu.ll b/llvm/test/Transforms/InstCombine/X86/x86-pmulhu.ll
index 5eed7328136de..81b890b7df6e6 100644
--- a/llvm/test/Transforms/InstCombine/X86/x86-pmulhu.ll
+++ b/llvm/test/Transforms/InstCombine/X86/x86-pmulhu.ll
@@ -7,8 +7,7 @@
define <8 x i16> @undef_pmulhu_128(<8 x i16> %a0) {
; CHECK-LABEL: @undef_pmulhu_128(
-; CHECK-NEXT: [[TMP1:%.*]] = call <8 x i16> @llvm.x86.sse2.pmulhu.w(<8 x i16> [[A0:%.*]], <8 x i16> undef)
-; CHECK-NEXT: ret <8 x i16> [[TMP1]]
+; CHECK-NEXT: ret <8 x i16> zeroinitializer
;
%1 = call <8 x i16> @llvm.x86.sse2.pmulhu.w(<8 x i16> %a0, <8 x i16> undef)
ret <8 x i16> %1
@@ -16,8 +15,7 @@ define <8 x i16> @undef_pmulhu_128(<8 x i16> %a0) {
define <8 x i16> @undef_pmulhu_128_commute(<8 x i16> %a0) {
; CHECK-LABEL: @undef_pmulhu_128_commute(
-; CHECK-NEXT: [[TMP1:%.*]] = call <8 x i16> @llvm.x86.sse2.pmulhu.w(<8 x i16> undef, <8 x i16> [[A0:%.*]])
-; CHECK-NEXT: ret <8 x i16> [[TMP1]]
+; CHECK-NEXT: ret <8 x i16> zeroinitializer
;
%1 = call <8 x i16> @llvm.x86.sse2.pmulhu.w(<8 x i16> undef, <8 x i16> %a0)
ret <8 x i16> %1
@@ -25,8 +23,7 @@ define <8 x i16> @undef_pmulhu_128_commute(<8 x i16> %a0) {
define <16 x i16> @undef_pmulhu_256(<16 x i16> %a0) {
; CHECK-LABEL: @undef_pmulhu_256(
-; CHECK-NEXT: [[TMP1:%.*]] = call <16 x i16> @llvm.x86.avx2.pmulhu.w(<16 x i16> [[A0:%.*]], <16 x i16> undef)
-; CHECK-NEXT: ret <16 x i16> [[TMP1]]
+; CHECK-NEXT: ret <16 x i16> zeroinitializer
;
%1 = call <16 x i16> @llvm.x86.avx2.pmulhu.w(<16 x i16> %a0, <16 x i16> undef)
ret <16 x i16> %1
@@ -34,8 +31,7 @@ define <16 x i16> @undef_pmulhu_256(<16 x i16> %a0) {
define <16 x i16> @undef_pmulhu_256_commute(<16 x i16> %a0) {
; CHECK-LABEL: @undef_pmulhu_256_commute(
-; CHECK-NEXT: [[TMP1:%.*]] = call <16 x i16> @llvm.x86.avx2.pmulhu.w(<16 x i16> undef, <16 x i16> [[A0:%.*]])
-; CHECK-NEXT: ret <16 x i16> [[TMP1]]
+; CHECK-NEXT: ret <16 x i16> zeroinitializer
;
%1 = call <16 x i16> @llvm.x86.avx2.pmulhu.w(<16 x i16> undef, <16 x i16> %a0)
ret <16 x i16> %1
@@ -43,8 +39,7 @@ define <16 x i16> @undef_pmulhu_256_commute(<16 x i16> %a0) {
define <32 x i16> @undef_pmulhu_512(<32 x i16> %a0) {
; CHECK-LABEL: @undef_pmulhu_512(
-; CHECK-NEXT: [[TMP1:%.*]] = call <32 x i16> @llvm.x86.avx512.pmulhu.w.512(<32 x i16> [[A0:%.*]], <32 x i16> undef)
-; CHECK-NEXT: ret <32 x i16> [[TMP1]]
+; CHECK-NEXT: ret <32 x i16> zeroinitializer
;
%1 = call <32 x i16> @llvm.x86.avx512.pmulhu.w.512(<32 x i16> %a0, <32 x i16> undef)
ret <32 x i16> %1
@@ -52,8 +47,7 @@ define <32 x i16> @undef_pmulhu_512(<32 x i16> %a0) {
define <32 x i16> @undef_pmulhu_512_commute(<32 x i16> %a0) {
; CHECK-LABEL: @undef_pmulhu_512_commute(
-; CHECK-NEXT: [[TMP1:%.*]] = call <32 x i16> @llvm.x86.avx512.pmulhu.w.512(<32 x i16> undef, <32 x i16> [[A0:%.*]])
-; CHECK-NEXT: ret <32 x i16> [[TMP1]]
+; CHECK-NEXT: ret <32 x i16> zeroinitializer
;
%1 = call <32 x i16> @llvm.x86.avx512.pmulhu.w.512(<32 x i16> undef, <32 x i16> %a0)
ret <32 x i16> %1
@@ -65,8 +59,7 @@ define <32 x i16> @undef_pmulhu_512_commute(<32 x i16> %a0) {
define <8 x i16> @zero_pmulhu_128(<8 x i16> %a0) {
; CHECK-LABEL: @zero_pmulhu_128(
-; CHECK-NEXT: [[TMP1:%.*]] = call <8 x i16> @llvm.x86.sse2.pmulhu.w(<8 x i16> [[A0:%.*]], <8 x i16> zeroinitializer)
-; CHECK-NEXT: ret <8 x i16> [[TMP1]]
+; CHECK-NEXT: ret <8 x i16> zeroinitializer
;
%1 = call <8 x i16> @llvm.x86.sse2.pmulhu.w(<8 x i16> %a0, <8 x i16> zeroinitializer)
ret <8 x i16> %1
@@ -74,8 +67,7 @@ define <8 x i16> @zero_pmulhu_128(<8 x i16> %a0) {
define <8 x i16> @zero_pmulhu_128_commute(<8 x i16> %a0) {
; CHECK-LABEL: @zero_pmulhu_128_commute(
-; CHECK-NEXT: [[TMP1:%.*]] = call <8 x i16> @llvm.x86.sse2.pmulhu.w(<8 x i16> zeroinitializer, <8 x i16> [[A0:%.*]])
-; CHECK-NEXT: ret <8 x i16> [[TMP1]]
+; CHECK-NEXT: ret <8 x i16> zeroinitializer
;
%1 = call <8 x i16> @llvm.x86.sse2.pmulhu.w(<8 x i16> zeroinitializer, <8 x i16> %a0)
ret <8 x i16> %1
@@ -83,8 +75,7 @@ define <8 x i16> @zero_pmulhu_128_commute(<8 x i16> %a0) {
define <16 x i16> @zero_pmulhu_256(<16 x i16> %a0) {
; CHECK-LABEL: @zero_pmulhu_256(
-; CHECK-NEXT: [[TMP1:%.*]] = call <16 x i16> @llvm.x86.avx2.pmulhu.w(<16 x i16> [[A0:%.*]], <16 x i16> zeroinitializer)
-; CHECK-NEXT: ret <16 x i16> [[TMP1]]
+; CHECK-NEXT: ret <16 x i16> zeroinitializer
;
%1 = call <16 x i16> @llvm.x86.avx2.pmulhu.w(<16 x i16> %a0, <16 x i16> zeroinitializer)
ret <16 x i16> %1
@@ -92,8 +83,7 @@ define <16 x i16> @zero_pmulhu_256(<16 x i16> %a0) {
define <16 x i16> @zero_pmulhu_256_commute(<16 x i16> %a0) {
; CHECK-LABEL: @zero_pmulhu_256_commute(
-; CHECK-NEXT: [[TMP1:%.*]] = call <16 x i16> @llvm.x86.avx2.pmulhu.w(<16 x i16> zeroinitializer, <16 x i16> [[A0:%.*]])
-; CHECK-NEXT: ret <16 x i16> [[TMP1]]
+; CHECK-NEXT: ret <16 x i16> zeroinitializer
;
%1 = call <16 x i16> @llvm.x86.avx2.pmulhu.w(<16 x i16> zeroinitializer, <16 x i16> %a0)
ret <16 x i16> %1
@@ -101,8 +91,7 @@ define <16 x i16> @zero_pmulhu_256_commute(<16 x i16> %a0) {
define <32 x i16> @zero_pmulhu_512(<32 x i16> %a0) {
; CHECK-LABEL: @zero_pmulhu_512(
-; CHECK-NEXT: [[TMP1:%.*]] = call <32 x i16> @llvm.x86.avx512.pmulhu.w.512(<32 x i16> [[A0:%.*]], <32 x i16> zeroinitializer)
-; CHECK-NEXT: ret <32 x i16> [[TMP1]]
+; CHECK-NEXT: ret <32 x i16> zeroinitializer
;
%1 = call <32 x i16> @llvm.x86.avx512.pmulhu.w.512(<32 x i16> %a0, <32 x i16> zeroinitializer)
ret <32 x i16> %1
@@ -110,8 +99,7 @@ define <32 x i16> @zero_pmulhu_512(<32 x i16> %a0) {
define <32 x i16> @zero_pmulhu_512_commute(<32 x i16> %a0) {
; CHECK-LABEL: @zero_pmulhu_512_commute(
-; CHECK-NEXT: [[TMP1:%.*]] = call <32 x i16> @llvm.x86.avx512.pmulhu.w.512(<32 x i16> zeroinitializer, <32 x i16> [[A0:%.*]])
-; CHECK-NEXT: ret <32 x i16> [[TMP1]]
+; CHECK-NEXT: ret <32 x i16> zeroinitializer
;
%1 = call <32 x i16> @llvm.x86.avx512.pmulhu.w.512(<32 x i16> zeroinitializer, <32 x i16> %a0)
ret <32 x i16> %1
More information about the llvm-commits
mailing list