From 3bbaece5a02785049d9d70d6579e22a54fa3bb06 Mon Sep 17 00:00:00 2001 From: David Sherwood Date: Wed, 3 Feb 2021 11:15:17 +0000 Subject: [PATCH] [Analysis] Remove unused functions from TargetLibraryInfo A simple clean-up to remove dead code. Differential Revision: https://reviews.llvm.org/D95934 --- llvm/include/llvm/Analysis/TargetLibraryInfo.h | 12 ------------ llvm/lib/Analysis/TargetLibraryInfo.cpp | 18 ------------------ 2 files changed, 30 deletions(-) diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.h b/llvm/include/llvm/Analysis/TargetLibraryInfo.h index 34a8a1e..b4a1d2b 100644 --- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h +++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h @@ -164,18 +164,6 @@ public: /// such mapping exists, return the empty string. StringRef getVectorizedFunction(StringRef F, unsigned VF) const; - /// Return true if the function F has a scalar equivalent, and set VF to be - /// the vectorization factor. - bool isFunctionScalarizable(StringRef F, unsigned &VF) const { - return !getScalarizedFunction(F, VF).empty(); - } - - /// Return the name of the equivalent of F, scalarized. If no such mapping - /// exists, return the empty string. - /// - /// Set VF to the vectorization factor. - StringRef getScalarizedFunction(StringRef F, unsigned &VF) const; - /// Set to true iff i32 parameters to library functions should have signext /// or zeroext attributes if they correspond to C-level int or unsigned int, /// respectively. diff --git a/llvm/lib/Analysis/TargetLibraryInfo.cpp b/llvm/lib/Analysis/TargetLibraryInfo.cpp index a4de21a..c85b122 100644 --- a/llvm/lib/Analysis/TargetLibraryInfo.cpp +++ b/llvm/lib/Analysis/TargetLibraryInfo.cpp @@ -1550,10 +1550,6 @@ static bool compareWithScalarFnName(const VecDesc &LHS, StringRef S) { return LHS.ScalarFnName < S; } -static bool compareWithVectorFnName(const VecDesc &LHS, StringRef S) { - return LHS.VectorFnName < S; -} - void TargetLibraryInfoImpl::addVectorizableFunctions(ArrayRef Fns) { llvm::append_range(VectorDescs, Fns); llvm::sort(VectorDescs, compareByScalarFnName); @@ -1627,20 +1623,6 @@ StringRef TargetLibraryInfoImpl::getVectorizedFunction(StringRef F, return StringRef(); } -StringRef TargetLibraryInfoImpl::getScalarizedFunction(StringRef F, - unsigned &VF) const { - F = sanitizeFunctionName(F); - if (F.empty()) - return F; - - std::vector::const_iterator I = - llvm::lower_bound(ScalarDescs, F, compareWithVectorFnName); - if (I == VectorDescs.end() || StringRef(I->VectorFnName) != F) - return StringRef(); - VF = I->VectorizationFactor; - return I->ScalarFnName; -} - TargetLibraryInfo TargetLibraryAnalysis::run(const Function &F, FunctionAnalysisManager &) { if (!BaselineInfoImpl) -- 2.7.4