From: Craig Topper Date: Sat, 5 Nov 2016 05:35:23 +0000 (+0000) Subject: [AVX-512] Use an equality compare instead of StringRef::startswith in a few places... X-Git-Tag: android-x86-7.1-r4~24938 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=de7c14666a2d4095f3501d201f7394f9afcc4380;p=android-x86%2Fexternal-llvm.git [AVX-512] Use an equality compare instead of StringRef::startswith in a few places in auto upgrade that were looking for the complete intrinsic name anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286033 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/IR/AutoUpgrade.cpp b/lib/IR/AutoUpgrade.cpp index e6b80c58c0b..b2c65a49a75 100644 --- a/lib/IR/AutoUpgrade.cpp +++ b/lib/IR/AutoUpgrade.cpp @@ -279,22 +279,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 == "avx512.mask.add.pd.128" || + Name == "avx512.mask.add.pd.256" || + Name == "avx512.mask.add.ps.128" || + Name == "avx512.mask.add.ps.256" || + Name == "avx512.mask.div.pd.128" || + Name == "avx512.mask.div.pd.256" || + Name == "avx512.mask.div.ps.128" || + Name == "avx512.mask.div.ps.256" || + Name == "avx512.mask.mul.pd.128" || + Name == "avx512.mask.mul.pd.256" || + Name == "avx512.mask.mul.ps.128" || + Name == "avx512.mask.mul.ps.256" || + Name == "avx512.mask.sub.pd.128" || + Name == "avx512.mask.sub.pd.256" || + Name == "avx512.mask.sub.ps.128" || + Name == "avx512.mask.sub.ps.256" || Name.startswith("sse41.pmovsx") || Name.startswith("sse41.pmovzx") || Name.startswith("avx2.pmovsx") || @@ -1298,31 +1298,28 @@ 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"))) { + } else if (IsX86 && (Name.startswith("avx512.mask.add.p"))) { 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"))) { + } else if (IsX86 && (Name == "avx512.mask.div.pd.128" || + Name == "avx512.mask.div.pd.256" || + Name == "avx512.mask.div.ps.128" || + Name == "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"))) { + } else if (IsX86 && (Name == "avx512.mask.mul.pd.128" || + Name == "avx512.mask.mul.pd.256" || + Name == "avx512.mask.mul.ps.128" || + Name == "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"))) { + } else if (IsX86 && (Name == "avx512.mask.sub.pd.128" || + Name == "avx512.mask.sub.pd.256" || + Name == "avx512.mask.sub.ps.128" || + Name == "avx512.mask.sub.ps.256")) { Rep = Builder.CreateFSub(CI->getArgOperand(0), CI->getArgOperand(1)); Rep = EmitX86Select(Builder, CI->getArgOperand(3), Rep, CI->getArgOperand(2));