summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/AutoUpgrade.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2016-09-04 02:09:53 +0000
committerCraig Topper <craig.topper@gmail.com>2016-09-04 02:09:53 +0000
commitaf0d63d2e7eed6f338dea599de842366137237dc (patch)
treea4af0be9cb64d8af7a7c11cad667a0283ef467f7 /llvm/lib/IR/AutoUpgrade.cpp
parente92e0a904239fbb1d3d98f023e76cf894b2b4476 (diff)
downloadbcm5719-llvm-af0d63d2e7eed6f338dea599de842366137237dc.tar.gz
bcm5719-llvm-af0d63d2e7eed6f338dea599de842366137237dc.zip
[AVX-512] Remove masked integer add/sub/mull intrinsics and upgrade to native IR.
llvm-svn: 280611
Diffstat (limited to 'llvm/lib/IR/AutoUpgrade.cpp')
-rw-r--r--llvm/lib/IR/AutoUpgrade.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/IR/AutoUpgrade.cpp b/llvm/lib/IR/AutoUpgrade.cpp
index 12c48fbf2f6..5f62802654e 100644
--- a/llvm/lib/IR/AutoUpgrade.cpp
+++ b/llvm/lib/IR/AutoUpgrade.cpp
@@ -271,6 +271,9 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) {
Name.startswith("avx512.mask.andn.") ||
Name.startswith("avx512.mask.or.") ||
Name.startswith("avx512.mask.xor.") ||
+ Name.startswith("avx512.mask.padd.") ||
+ Name.startswith("avx512.mask.psub.") ||
+ Name.startswith("avx512.mask.pmull.") ||
Name.startswith("sse41.pmovsx") ||
Name.startswith("sse41.pmovzx") ||
Name.startswith("avx2.pmovsx") ||
@@ -1234,6 +1237,18 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) {
Rep = Builder.CreateBitCast(Rep, FTy);
Rep = EmitX86Select(Builder, CI->getArgOperand(3), Rep,
CI->getArgOperand(2));
+ } else if (IsX86 && Name.startswith("avx512.mask.padd.")) {
+ Rep = Builder.CreateAdd(CI->getArgOperand(0), CI->getArgOperand(1));
+ Rep = EmitX86Select(Builder, CI->getArgOperand(3), Rep,
+ CI->getArgOperand(2));
+ } else if (IsX86 && Name.startswith("avx512.mask.psub.")) {
+ Rep = Builder.CreateSub(CI->getArgOperand(0), CI->getArgOperand(1));
+ Rep = EmitX86Select(Builder, CI->getArgOperand(3), Rep,
+ CI->getArgOperand(2));
+ } else if (IsX86 && Name.startswith("avx512.mask.pmull.")) {
+ Rep = Builder.CreateMul(CI->getArgOperand(0), CI->getArgOperand(1));
+ Rep = EmitX86Select(Builder, CI->getArgOperand(3), Rep,
+ CI->getArgOperand(2));
} else {
llvm_unreachable("Unknown function for CallInst upgrade.");
}
OpenPOWER on IntegriCloud