diff options
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."); } |