Move Function Specialization to its correct location. NFC.

As a follow up of rGc4a0969b9c14, and as part of D104102, move it to
the IPO transformations directory.
This commit is contained in:
Sjoerd Meijer 2021-06-11 14:43:49 +01:00
parent 150f7cedfb
commit 9907746f5d
3 changed files with 2 additions and 3 deletions

View File

@ -15,6 +15,7 @@ add_llvm_component_library(LLVMipo
ForceFunctionAttrs.cpp
FunctionAttrs.cpp
FunctionImport.cpp
FunctionSpecialization.cpp
GlobalDCE.cpp
GlobalOpt.cpp
GlobalSplit.cpp

View File

@ -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);

View File

@ -13,7 +13,6 @@ add_llvm_component_library(LLVMScalarOpts
EarlyCSE.cpp
FlattenCFGPass.cpp
Float2Int.cpp
FunctionSpecialization.cpp
GuardWidening.cpp
GVN.cpp
GVNHoist.cpp