From 4177345d7fe6b186ed34400b1562fde4b47db1ec Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Sun, 4 Sep 2016 18:13:33 +0000 Subject: [AVX-512] Remove 128-bit and 256-bit masked floating point add/sub/mul/div intrinsics and upgrade to native IR. llvm-svn: 280633 --- llvm/lib/IR/AutoUpgrade.cpp | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'llvm/lib/IR/AutoUpgrade.cpp') 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."); } -- cgit v1.2.3