Skip to content

Commit

Permalink
Move Function Specialization to its correct location. NFC.
Browse files Browse the repository at this point in the history
As a follow up of rGc4a0969b9c14, and as part of D104102, move it to
the IPO transformations directory.
  • Loading branch information
Sjoerd Meijer committed Jun 11, 2021
1 parent 150f7ce commit 9907746
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions llvm/lib/Transforms/IPO/CMakeLists.txt
Expand Up @@ -15,6 +15,7 @@ add_llvm_component_library(LLVMipo
ForceFunctionAttrs.cpp
FunctionAttrs.cpp
FunctionImport.cpp
FunctionSpecialization.cpp
GlobalDCE.cpp
GlobalOpt.cpp
GlobalSplit.cpp
Expand Down
Expand Up @@ -247,7 +247,7 @@ class FunctionSpecializer {

// 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;
}

Expand Down Expand Up @@ -506,7 +506,6 @@ class FunctionSpecializer {
CallSitesToRewrite.push_back(&CS);
}
for (auto *CS : CallSitesToRewrite) {

if ((CS->getFunction() == Clone && CS->getArgOperand(ArgNo) == &Arg) ||
CS->getArgOperand(ArgNo) == C) {
CS->setCalledFunction(Clone);
Expand Down
1 change: 0 additions & 1 deletion llvm/lib/Transforms/Scalar/CMakeLists.txt
Expand Up @@ -13,7 +13,6 @@ add_llvm_component_library(LLVMScalarOpts
EarlyCSE.cpp
FlattenCFGPass.cpp
Float2Int.cpp
FunctionSpecialization.cpp
GuardWidening.cpp
GVN.cpp
GVNHoist.cpp
Expand Down

0 comments on commit 9907746

Please sign in to comment.