diff --git a/llvm/lib/Transforms/IPO/CMakeLists.txt b/llvm/lib/Transforms/IPO/CMakeLists.txt index 34788bc10f01..2392b13b33a0 100644 --- a/llvm/lib/Transforms/IPO/CMakeLists.txt +++ b/llvm/lib/Transforms/IPO/CMakeLists.txt @@ -15,6 +15,7 @@ add_llvm_component_library(LLVMipo ForceFunctionAttrs.cpp FunctionAttrs.cpp FunctionImport.cpp + FunctionSpecialization.cpp GlobalDCE.cpp GlobalOpt.cpp GlobalSplit.cpp diff --git a/llvm/lib/Transforms/Scalar/FunctionSpecialization.cpp b/llvm/lib/Transforms/IPO/FunctionSpecialization.cpp similarity index 99% rename from llvm/lib/Transforms/Scalar/FunctionSpecialization.cpp rename to llvm/lib/Transforms/IPO/FunctionSpecialization.cpp index 4639f416d78a..0f6b13505816 100644 --- a/llvm/lib/Transforms/Scalar/FunctionSpecialization.cpp +++ b/llvm/lib/Transforms/IPO/FunctionSpecialization.cpp @@ -247,7 +247,7 @@ private: // Otherwise, set the specialization cost to be the cost of all the // instructions in the function and penalty for specializing more functions. - unsigned Penalty = (NumFuncSpecialized + 1); + unsigned Penalty = NumFuncSpecialized + 1; return Metrics.NumInsts * InlineConstants::InstrCost * Penalty; } @@ -506,7 +506,6 @@ private: CallSitesToRewrite.push_back(&CS); } for (auto *CS : CallSitesToRewrite) { - if ((CS->getFunction() == Clone && CS->getArgOperand(ArgNo) == &Arg) || CS->getArgOperand(ArgNo) == C) { CS->setCalledFunction(Clone); diff --git a/llvm/lib/Transforms/Scalar/CMakeLists.txt b/llvm/lib/Transforms/Scalar/CMakeLists.txt index 99ae122840ee..45619c4c3cd3 100644 --- a/llvm/lib/Transforms/Scalar/CMakeLists.txt +++ b/llvm/lib/Transforms/Scalar/CMakeLists.txt @@ -13,7 +13,6 @@ add_llvm_component_library(LLVMScalarOpts EarlyCSE.cpp FlattenCFGPass.cpp Float2Int.cpp - FunctionSpecialization.cpp GuardWidening.cpp GVN.cpp GVNHoist.cpp