diff options
author | Craig Topper <craig.topper@gmail.com> | 2016-09-04 18:13:33 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2016-09-04 18:13:33 +0000 |
commit | 4177345d7fe6b186ed34400b1562fde4b47db1ec (patch) | |
tree | 2898cdb41fc0a0cd528622fb0382ad7cf1a53b7f /llvm/lib/IR/AutoUpgrade.cpp | |
parent | 38c7927b6f6c54ea48144b3d39aaffb18c31aee4 (diff) | |
download | bcm5719-llvm-4177345d7fe6b186ed34400b1562fde4b47db1ec.tar.gz bcm5719-llvm-4177345d7fe6b186ed34400b1562fde4b47db1ec.zip |
[AVX-512] Remove 128-bit and 256-bit masked floating point add/sub/mul/div intrinsics and upgrade to native IR.
llvm-svn: 280633
Diffstat (limited to 'llvm/lib/IR/AutoUpgrade.cpp')
-rw-r--r-- | llvm/lib/IR/AutoUpgrade.cpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/llvm/lib/IR/AutoUpgrade.cpp b/llvm/lib/IR/AutoUpgrade.cpp index 5f62802654e..79a8d18126d 100644 --- a/llvm/lib/IR/AutoUpgrade.cpp +++ b/llvm/lib/IR/AutoUpgrade.cpp @@ -274,6 +274,22 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) { Name.startswith("avx512.mask.padd.") || Name.startswith("avx512.mask.psub.") || Name.startswith("avx512.mask.pmull.") || + Name.startswith("avx512.mask.add.pd.128") || + Name.startswith("avx512.mask.add.pd.256") || + Name.startswith("avx512.mask.add.ps.128") || + Name.startswith("avx512.mask.add.ps.256") || + Name.startswith("avx512.mask.div.pd.128") || + Name.startswith("avx512.mask.div.pd.256") || + Name.startswith("avx512.mask.div.ps.128") || + Name.startswith("avx512.mask.div.ps.256") || + Name.startswith("avx512.mask.mul.pd.128") || + Name.startswith("avx512.mask.mul.pd.256") || + Name.startswith("avx512.mask.mul.ps.128") || + Name.startswith("avx512.mask.mul.ps.256") || + Name.startswith("avx512.mask.sub.pd.128") || + Name.startswith("avx512.mask.sub.pd.256") || + Name.startswith("avx512.mask.sub.ps.128") || + Name.startswith("avx512.mask.sub.ps.256") || Name.startswith("sse41.pmovsx") || Name.startswith("sse41.pmovzx") || Name.startswith("avx2.pmovsx") || @@ -1249,6 +1265,34 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) { Rep = Builder.CreateMul(CI->getArgOperand(0), CI->getArgOperand(1)); Rep = EmitX86Select(Builder, CI->getArgOperand(3), Rep, CI->getArgOperand(2)); + } else if (IsX86 && (Name.startswith("avx512.mask.add.pd.128") || + Name.startswith("avx512.mask.add.pd.256") || + Name.startswith("avx512.mask.add.ps.128") || + Name.startswith("avx512.mask.add.ps.256"))) { + Rep = Builder.CreateFAdd(CI->getArgOperand(0), CI->getArgOperand(1)); + Rep = EmitX86Select(Builder, CI->getArgOperand(3), Rep, + CI->getArgOperand(2)); + } else if (IsX86 && (Name.startswith("avx512.mask.div.pd.128") || + Name.startswith("avx512.mask.div.pd.256") || + Name.startswith("avx512.mask.div.ps.128") || + Name.startswith("avx512.mask.div.ps.256"))) { + Rep = Builder.CreateFDiv(CI->getArgOperand(0), CI->getArgOperand(1)); + Rep = EmitX86Select(Builder, CI->getArgOperand(3), Rep, + CI->getArgOperand(2)); + } else if (IsX86 && (Name.startswith("avx512.mask.mul.pd.128") || + Name.startswith("avx512.mask.mul.pd.256") || + Name.startswith("avx512.mask.mul.ps.128") || + Name.startswith("avx512.mask.mul.ps.256"))) { + Rep = Builder.CreateFMul(CI->getArgOperand(0), CI->getArgOperand(1)); + Rep = EmitX86Select(Builder, CI->getArgOperand(3), Rep, + CI->getArgOperand(2)); + } else if (IsX86 && (Name.startswith("avx512.mask.sub.pd.128") || + Name.startswith("avx512.mask.sub.pd.256") || + Name.startswith("avx512.mask.sub.ps.128") || + Name.startswith("avx512.mask.sub.ps.256"))) { + Rep = Builder.CreateFSub(CI->getArgOperand(0), CI->getArgOperand(1)); + Rep = EmitX86Select(Builder, CI->getArgOperand(3), Rep, + CI->getArgOperand(2)); } else { llvm_unreachable("Unknown function for CallInst upgrade."); } |