diff options
| author | Craig Topper <craig.topper@gmail.com> | 2016-11-06 16:29:14 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@gmail.com> | 2016-11-06 16:29:14 +0000 |
| commit | af9b3fe752815ce0a046a0117f9ca64bd8faf5b1 (patch) | |
| tree | 22ffa9bf2d1d0fe407ff7040508f5462cd3d3c89 /llvm/lib/IR | |
| parent | dd4809a6036f19e5e54d97af090911d2dcf21a0f (diff) | |
| download | bcm5719-llvm-af9b3fe752815ce0a046a0117f9ca64bd8faf5b1.tar.gz bcm5719-llvm-af9b3fe752815ce0a046a0117f9ca64bd8faf5b1.zip | |
[AVX-512] Remove intrinsics for 128/256-bit masked shift by immediate. Instead upgrade them to a select and the older SSE/AVX2 intrinsic.
llvm-svn: 286072
Diffstat (limited to 'llvm/lib/IR')
| -rw-r--r-- | llvm/lib/IR/AutoUpgrade.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/llvm/lib/IR/AutoUpgrade.cpp b/llvm/lib/IR/AutoUpgrade.cpp index 9001af5c0ec..68239c0c9a0 100644 --- a/llvm/lib/IR/AutoUpgrade.cpp +++ b/llvm/lib/IR/AutoUpgrade.cpp @@ -311,6 +311,22 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) { Name == "avx512.mask.psrl.q.256" || Name == "avx512.mask.psrl.w.128" || Name == "avx512.mask.psrl.w.256" || + Name == "avx512.mask.psll.di.128" || + Name == "avx512.mask.psll.di.256" || + Name == "avx512.mask.psll.qi.128" || + Name == "avx512.mask.psll.qi.256" || + Name == "avx512.mask.psll.wi.128" || + Name == "avx512.mask.psll.wi.256" || + Name == "avx512.mask.psra.di.128" || + Name == "avx512.mask.psra.di.256" || + Name == "avx512.mask.psra.wi.128" || + Name == "avx512.mask.psra.wi.256" || + Name == "avx512.mask.psrl.di.128" || + Name == "avx512.mask.psrl.di.256" || + Name == "avx512.mask.psrl.qi.128" || + Name == "avx512.mask.psrl.qi.256" || + Name == "avx512.mask.psrl.wi.128" || + Name == "avx512.mask.psrl.wi.256" || Name.startswith("sse41.pmovsx") || Name.startswith("sse41.pmovzx") || Name.startswith("avx2.pmovsx") || @@ -1382,6 +1398,38 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) { Rep = UpgradeX86MaskedShift(Builder, *CI, Intrinsic::x86_sse2_psrl_w); } else if (IsX86 && Name == "avx512.mask.psrl.w.256") { Rep = UpgradeX86MaskedShift(Builder, *CI, Intrinsic::x86_avx2_psrl_w); + } else if (IsX86 && Name == "avx512.mask.psll.di.128") { + Rep = UpgradeX86MaskedShift(Builder, *CI, Intrinsic::x86_sse2_pslli_d); + } else if (IsX86 && Name == "avx512.mask.psll.di.256") { + Rep = UpgradeX86MaskedShift(Builder, *CI, Intrinsic::x86_avx2_pslli_d); + } else if (IsX86 && Name == "avx512.mask.psll.qi.128") { + Rep = UpgradeX86MaskedShift(Builder, *CI, Intrinsic::x86_sse2_pslli_q); + } else if (IsX86 && Name == "avx512.mask.psll.qi.256") { + Rep = UpgradeX86MaskedShift(Builder, *CI, Intrinsic::x86_avx2_pslli_q); + } else if (IsX86 && Name == "avx512.mask.psll.wi.128") { + Rep = UpgradeX86MaskedShift(Builder, *CI, Intrinsic::x86_sse2_pslli_w); + } else if (IsX86 && Name == "avx512.mask.psll.wi.256") { + Rep = UpgradeX86MaskedShift(Builder, *CI, Intrinsic::x86_avx2_pslli_w); + } else if (IsX86 && Name == "avx512.mask.psra.di.128") { + Rep = UpgradeX86MaskedShift(Builder, *CI, Intrinsic::x86_sse2_psrai_d); + } else if (IsX86 && Name == "avx512.mask.psra.di.256") { + Rep = UpgradeX86MaskedShift(Builder, *CI, Intrinsic::x86_avx2_psrai_d); + } else if (IsX86 && Name == "avx512.mask.psra.wi.128") { + Rep = UpgradeX86MaskedShift(Builder, *CI, Intrinsic::x86_sse2_psrai_w); + } else if (IsX86 && Name == "avx512.mask.psra.wi.256") { + Rep = UpgradeX86MaskedShift(Builder, *CI, Intrinsic::x86_avx2_psrai_w); + } else if (IsX86 && Name == "avx512.mask.psrl.di.128") { + Rep = UpgradeX86MaskedShift(Builder, *CI, Intrinsic::x86_sse2_psrli_d); + } else if (IsX86 && Name == "avx512.mask.psrl.di.256") { + Rep = UpgradeX86MaskedShift(Builder, *CI, Intrinsic::x86_avx2_psrli_d); + } else if (IsX86 && Name == "avx512.mask.psrl.qi.128") { + Rep = UpgradeX86MaskedShift(Builder, *CI, Intrinsic::x86_sse2_psrli_q); + } else if (IsX86 && Name == "avx512.mask.psrl.qi.256") { + Rep = UpgradeX86MaskedShift(Builder, *CI, Intrinsic::x86_avx2_psrli_q); + } else if (IsX86 && Name == "avx512.mask.psrl.wi.128") { + Rep = UpgradeX86MaskedShift(Builder, *CI, Intrinsic::x86_sse2_psrli_w); + } else if (IsX86 && Name == "avx512.mask.psrl.wi.256") { + Rep = UpgradeX86MaskedShift(Builder, *CI, Intrinsic::x86_avx2_psrli_w); } else { llvm_unreachable("Unknown function for CallInst upgrade."); } |

